summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c14
-rw-r--r--src/systemd/sd-rtnl.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index ccef7165b0..44ad303198 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -186,6 +186,20 @@ int sd_rtnl_message_link_set_type(sd_rtnl_message *m, unsigned type) {
return 0;
}
+int sd_rtnl_message_link_set_family(sd_rtnl_message *m, unsigned family) {
+ struct ifinfomsg *ifi;
+
+ assert_return(m, -EINVAL);
+ assert_return(m->hdr, -EINVAL);
+ assert_return(rtnl_message_type_is_link(m->hdr->nlmsg_type), -EINVAL);
+
+ ifi = NLMSG_DATA(m->hdr);
+
+ ifi->ifi_family = family;
+
+ return 0;
+}
+
int sd_rtnl_message_new_link(sd_rtnl *rtnl, sd_rtnl_message **ret,
uint16_t nlmsg_type, int index) {
struct ifinfomsg *ifi;
diff --git a/src/systemd/sd-rtnl.h b/src/systemd/sd-rtnl.h
index 1e7eb811d1..0980de8e3f 100644
--- a/src/systemd/sd-rtnl.h
+++ b/src/systemd/sd-rtnl.h
@@ -93,6 +93,7 @@ int sd_rtnl_message_addr_get_ifindex(sd_rtnl_message *m, int *ifindex);
int sd_rtnl_message_link_set_flags(sd_rtnl_message *m, unsigned flags, unsigned change);
int sd_rtnl_message_link_set_type(sd_rtnl_message *m, unsigned type);
+int sd_rtnl_message_link_set_family(sd_rtnl_message *m, unsigned family);
int sd_rtnl_message_link_get_ifindex(sd_rtnl_message *m, int *ifindex);
int sd_rtnl_message_link_get_flags(sd_rtnl_message *m, unsigned *flags);
int sd_rtnl_message_link_get_type(sd_rtnl_message *m, unsigned *type);