summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/sd-rtnl.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-10 20:15:52 +0200
committerTom Gundersen <teg@jklm.no>2014-05-10 20:56:37 +0200
commit66269b05cf31ef5d8f83a7150c314bf35ee8a35e (patch)
tree05d730cd2b874f9b1ba0a5f0a1200410711e1513 /src/libsystemd/sd-rtnl/sd-rtnl.c
parent26349add97c8e9bfd26f2f16d61dd80a324f504e (diff)
rtnl: message - read group membership of incoming messages
Diffstat (limited to 'src/libsystemd/sd-rtnl/sd-rtnl.c')
-rw-r--r--src/libsystemd/sd-rtnl/sd-rtnl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index 4ee360c0a8..b91d08012a 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -22,6 +22,7 @@
#include <sys/socket.h>
#include <poll.h>
+#include "missing.h"
#include "macro.h"
#include "util.h"
#include "hashmap.h"
@@ -109,7 +110,12 @@ int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) {
if (rtnl->fd < 0)
return -errno;
- if (setsockopt(rtnl->fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) < 0)
+ r = setsockopt(rtnl->fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
+ if (r < 0)
+ return -errno;
+
+ r = setsockopt(rtnl->fd, SOL_NETLINK, NETLINK_PKTINFO, &one, sizeof(one));
+ if (r < 0)
return -errno;
va_start(ap, n_groups);