chiark / gitweb /
networkd: Begin with serial number 1 for netlink requests
[elogind.git] / src / libsystemd / sd-rtnl / sd-rtnl.c
index ae49c77e018f4e023c11b519453e4de01c4d6b38..7cdcc5d96a10d818620b13bd241bdc73c8da687c 100644 (file)
@@ -61,6 +61,11 @@ static int sd_rtnl_new(sd_rtnl **ret) {
                             sizeof(struct nlmsghdr), sizeof(uint8_t)))
                 return -ENOMEM;
 
+        /* Change notification responses have sequence 0, so we must
+         * start our request sequence numbers at 1, or we may confuse our
+         * responses with notifications from the kernel */
+        rtnl->serial = 1;
+
         *ret = rtnl;
         rtnl = NULL;