Message ID | 20240726161232.146982-6-denkenz@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/7] netlink: Remove pointless checks | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
diff --git a/ell/netlink-private.h b/ell/netlink-private.h index b114f62f6bf3..f7119f6218e9 100644 --- a/ell/netlink-private.h +++ b/ell/netlink-private.h @@ -40,6 +40,7 @@ struct l_netlink_message { }; uint32_t nest_offset[4]; uint8_t nest_level; + bool sealed : 1; }; bool netlink_parse_ext_ack_error(const struct nlmsghdr *nlmsg, diff --git a/ell/netlink.c b/ell/netlink.c index 58dfd9779875..b6d5fb1fd36d 100644 --- a/ell/netlink.c +++ b/ell/netlink.c @@ -685,6 +685,9 @@ static int message_grow(struct l_netlink_message *message, uint32_t needed) { uint32_t grow_to; + if (message->sealed) + return -EPERM; + if (message->size - message->hdr->nlmsg_len >= needed) return 0;