803fb7
From fc9d7a3891dc293cccd4e127cfb1e2355f4e93da Mon Sep 17 00:00:00 2001
803fb7
From: Tom Gundersen <teg@jklm.no>
803fb7
Date: Fri, 13 Mar 2015 15:49:07 +0100
803fb7
Subject: [PATCH] sd-rtnl: never set serial to 0
803fb7
803fb7
In the unlikely event that we wrap the counter, skip 0 as this is used
803fb7
for broadcasts.
803fb7
803fb7
Suggested by Richard Maw.
803fb7
803fb7
(cherry picked from commit 913b0eef1a01e0c78f0453b0174e75d5caae1023)
803fb7
---
803fb7
 src/libsystemd/sd-rtnl/sd-rtnl.c | 2 +-
803fb7
 1 file changed, 1 insertion(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/libsystemd/sd-rtnl/sd-rtnl.c b/src/libsystemd/sd-rtnl/sd-rtnl.c
803fb7
index 7cdcc5d96..5df39e117 100644
803fb7
--- a/src/libsystemd/sd-rtnl/sd-rtnl.c
803fb7
+++ b/src/libsystemd/sd-rtnl/sd-rtnl.c
803fb7
@@ -262,7 +262,7 @@ static void rtnl_seal_message(sd_rtnl *rtnl, sd_rtnl_message *m) {
803fb7
         assert(m);
803fb7
         assert(m->hdr);
803fb7
 
803fb7
-        m->hdr->nlmsg_seq = rtnl->serial++;
803fb7
+        m->hdr->nlmsg_seq = rtnl->serial++ ? : rtnl->serial++;
803fb7
 
803fb7
         rtnl_message_seal(m);
803fb7