]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: make timeout message sealed
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 19 Jul 2020 15:57:40 +0000 (00:57 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Jul 2020 05:49:55 +0000 (07:49 +0200)
When sd_netlink_call_async() timed out, then we reply the synthetic
error message, but it was not sealed. So, reading the message causes
the following assertion:

```
Assertion 'm->sealed' failed at src/libsystemd/sd-netlink/netlink-message.c:652, function netlink_message_read_internal(). Ignoring.
```

src/libsystemd/sd-netlink/netlink-util.c

index 7387cffaa3a06adff5a2d866e8f4aee08194a983..ce1911d5423d37eb5fc79d897b0bfb394d78c000 100644 (file)
@@ -236,10 +236,10 @@ int rtnl_message_new_synthetic_error(sd_netlink *rtnl, int error, uint32_t seria
         if (r < 0)
                 return r;
 
+        rtnl_message_seal(*ret);
         (*ret)->hdr->nlmsg_seq = serial;
 
         err = NLMSG_DATA((*ret)->hdr);
-
         err->error = error;
 
         return 0;