Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147501483
D48311.id148746.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48311.id148746.diff
View Options
diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h
--- a/sys/netlink/netlink_snl.h
+++ b/sys/netlink/netlink_snl.h
@@ -1108,20 +1108,22 @@
#define snl_reserve_msg_object(_ns, _t) ((_t *)snl_reserve_msg_data_raw(_ns, sizeof(_t)))
#define snl_reserve_msg_data(_ns, _sz, _t) ((_t *)snl_reserve_msg_data_raw(_ns, _sz))
-static inline void *
-_snl_reserve_msg_attr(struct snl_writer *nw, uint16_t nla_type, uint16_t sz)
+static inline struct nlattr *
+snl_reserve_msg_attr_raw(struct snl_writer *nw, uint16_t nla_type, uint16_t sz)
{
- sz += sizeof(struct nlattr);
+ struct nlattr *nla;
- struct nlattr *nla = snl_reserve_msg_data(nw, sz, struct nlattr);
+ sz += sizeof(struct nlattr);
+ nla = snl_reserve_msg_data(nw, sz, struct nlattr);
if (__predict_false(nla == NULL))
return (NULL);
nla->nla_type = nla_type;
nla->nla_len = sz;
- return ((void *)(nla + 1));
+ return (nla);
}
-#define snl_reserve_msg_attr(_ns, _at, _t) ((_t *)_snl_reserve_msg_attr(_ns, _at, sizeof(_t)))
+#define snl_reserve_msg_attr(_ns, _at, _t) \
+ ((_t *)(snl_reserve_msg_attr_raw(_ns, _at, sizeof(_t)) + 1))
static inline bool
snl_add_msg_attr(struct snl_writer *nw, int attr_type, int attr_len, const void *data)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 12, 11:43 AM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29580787
Default Alt Text
D48311.id148746.diff (1 KB)
Attached To
Mode
D48311: netlink: provide snl(3) API for variable length raw data attribute
Attached
Detach File
Event Timeline
Log In to Comment