summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-09 21:37:04 +0200
committerTom Gundersen <teg@jklm.no>2015-10-11 15:04:16 +0200
commit87e4c847f63ba138fa9cc5047a00d2c80b6f0d1f (patch)
tree909fd056d0256bc2440242a31a04eccfc021b8dc /src/libsystemd
parentad70f78936e76ed30aaadda8fdf9ad934f438ef0 (diff)
sd-netlink: add support for subscribing to ROUTE messages
Also, explicitly don't support subscribing to GET or SET messages, as these will never be emitted by the kernel.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-netlink/sd-netlink.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c
index d248869c8d..f4a0a358a9 100644
--- a/src/libsystemd/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/sd-netlink/sd-netlink.c
@@ -856,8 +856,6 @@ int sd_netlink_add_match(sd_netlink *rtnl,
switch (type) {
case RTM_NEWLINK:
- case RTM_SETLINK:
- case RTM_GETLINK:
case RTM_DELLINK:
r = socket_join_broadcast_group(rtnl, RTNLGRP_LINK);
if (r < 0)
@@ -865,7 +863,6 @@ int sd_netlink_add_match(sd_netlink *rtnl,
break;
case RTM_NEWADDR:
- case RTM_GETADDR:
case RTM_DELADDR:
r = socket_join_broadcast_group(rtnl, RTNLGRP_IPV4_IFADDR);
if (r < 0)
@@ -876,6 +873,16 @@ int sd_netlink_add_match(sd_netlink *rtnl,
return r;
break;
+ case RTM_NEWROUTE:
+ case RTM_DELROUTE:
+ r = socket_join_broadcast_group(rtnl, RTNLGRP_IPV4_ROUTE);
+ if (r < 0)
+ return r;
+
+ r = socket_join_broadcast_group(rtnl, RTNLGRP_IPV6_ROUTE);
+ if (r < 0)
+ return r;
+ break;
default:
return -EOPNOTSUPP;
}