summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-07-21 13:15:38 +0530
committerTom Gundersen <teg@jklm.no>2014-10-29 10:59:46 +0100
commit64c8407133fdc1887785789d0fe574bc21035433 (patch)
treea9fc2e753e326f29d0cf598c1ddd640b180fc6a0 /src
parentfcf81a54a4a01349cbc75a9f04d49c6084c4f624 (diff)
sd-rtnl: add support to set packet family type
This patch adds functionality to set family type in the rtnl message for example PF_BRIDGE.
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);