summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl
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/libsystemd/sd-rtnl
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/libsystemd/sd-rtnl')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c14
1 files changed, 14 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;