platform: rename link_change() to link_change_extra()

There are many functions to replace properties of a link
(link_set_address, link_set_mtu, link_set_name, link_change,
etc.). Eventually, they will be replaced by a function that does
everything and removes all the code duplication.

That function will be named link_change(); rename the current
link_change() to link_change_extra().

(cherry picked from commit babe2bacd3)
(cherry picked from commit 9ae85f6541)
This commit is contained in:
Beniamino Galvani 2023-02-27 10:55:29 +01:00 committed by Fernando Fernandez Mancera
parent 40c523cd78
commit 0a158141d3
3 changed files with 19 additions and 13 deletions

View file

@ -7984,7 +7984,7 @@ out:
}
static int
link_change(NMPlatform *platform, NMLinkType type, int ifindex, gconstpointer extra_data)
link_change_extra(NMPlatform *platform, NMLinkType type, int ifindex, gconstpointer extra_data)
{
nm_auto_nlmsg struct nl_msg *nlmsg = NULL;
@ -10833,9 +10833,9 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass)
platform_class->sysctl_set_async = sysctl_set_async;
platform_class->sysctl_get = sysctl_get;
platform_class->link_add = link_add;
platform_class->link_change = link_change;
platform_class->link_delete = link_delete;
platform_class->link_add = link_add;
platform_class->link_change_extra = link_change_extra;
platform_class->link_delete = link_delete;
platform_class->link_refresh = link_refresh;

View file

@ -1388,7 +1388,10 @@ nm_platform_link_add(NMPlatform *self,
}
int
nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data)
nm_platform_link_change_extra(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data)
{
char buf[512];
const char *name = nm_platform_link_get_name(self, ifindex);
@ -1429,7 +1432,7 @@ nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpo
buf;
}));
return klass->link_change(self, type, ifindex, extra_data);
return klass->link_change_extra(self, type, ifindex, extra_data);
}
/**

View file

@ -1222,9 +1222,10 @@ typedef struct {
guint32 mtu,
gconstpointer extra_data,
const NMPlatformLink **out_link);
int (*link_change)(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data);
int (*link_change_extra)(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data);
gboolean (*link_delete)(NMPlatform *self, int ifindex);
gboolean (*link_refresh)(NMPlatform *self, int ifindex);
gboolean (*link_set_netns)(NMPlatform *self, int ifindex, int netns_fd);
@ -1749,8 +1750,10 @@ int nm_platform_link_add(NMPlatform *self,
gconstpointer extra_data,
const NMPlatformLink **out_link);
int
nm_platform_link_change(NMPlatform *self, NMLinkType type, int ifindex, gconstpointer extra_data);
int nm_platform_link_change_extra(NMPlatform *self,
NMLinkType type,
int ifindex,
gconstpointer extra_data);
static inline int
nm_platform_link_veth_add(NMPlatform *self,
@ -1790,13 +1793,13 @@ nm_platform_link_bridge_add(NMPlatform *self,
static inline int
nm_platform_link_bridge_change(NMPlatform *self, int ifindex, const NMPlatformLnkBridge *props)
{
return nm_platform_link_change(self, NM_LINK_TYPE_BRIDGE, ifindex, props);
return nm_platform_link_change_extra(self, NM_LINK_TYPE_BRIDGE, ifindex, props);
}
static inline int
nm_platform_link_bond_change(NMPlatform *self, int ifindex, const NMPlatformLnkBond *props)
{
return nm_platform_link_change(self, NM_LINK_TYPE_BOND, ifindex, props);
return nm_platform_link_change_extra(self, NM_LINK_TYPE_BOND, ifindex, props);
}
static inline int