summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl/sd-rtnl.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-03-13 16:12:57 +0100
committerTom Gundersen <teg@jklm.no>2015-03-13 16:12:57 +0100
commit3f42446d286a12292f1693d5cf9cb3ec3844e1a4 (patch)
treec0eda6f1a12d051bbd6c079518c838aba09326b6 /src/libsystemd/sd-rtnl/sd-rtnl.c
parent913b0eef1a01e0c78f0453b0174e75d5caae1023 (diff)
sd-rtnl: improve detection of broadcast messages
Do not rely on nl_pid == 0, but check the groups instead. We currently avoid using nl_pid == 0 for unicast anyway, so this should be redundant, but let's try to be correct.
Diffstat (limited to 'src/libsystemd/sd-rtnl/sd-rtnl.c')
-rw-r--r--src/libsystemd/sd-rtnl/sd-rtnl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
index f483af991b..c7a36b9efb 100644
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
@@ -262,6 +262,8 @@ static void rtnl_seal_message(sd_rtnl *rtnl, sd_rtnl_message *m) {
assert(m);
assert(m->hdr);
+ /* don't use seq == 0, as that is used for broadcasts, so we
+ would get confused by replies to such messages */
m->hdr->nlmsg_seq = rtnl->serial++ ? : rtnl->serial++;
rtnl_message_seal(m);