diff options
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r-- | include/linux/netlink.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 8d1cb419a930..e38407a23d04 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -156,7 +156,7 @@ struct netlink_notify | |||
156 | }; | 156 | }; |
157 | 157 | ||
158 | static __inline__ struct nlmsghdr * | 158 | static __inline__ struct nlmsghdr * |
159 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | 159 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) |
160 | { | 160 | { |
161 | struct nlmsghdr *nlh; | 161 | struct nlmsghdr *nlh; |
162 | int size = NLMSG_LENGTH(len); | 162 | int size = NLMSG_LENGTH(len); |
@@ -164,20 +164,23 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) | |||
164 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); | 164 | nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); |
165 | nlh->nlmsg_type = type; | 165 | nlh->nlmsg_type = type; |
166 | nlh->nlmsg_len = size; | 166 | nlh->nlmsg_len = size; |
167 | nlh->nlmsg_flags = 0; | 167 | nlh->nlmsg_flags = flags; |
168 | nlh->nlmsg_pid = pid; | 168 | nlh->nlmsg_pid = pid; |
169 | nlh->nlmsg_seq = seq; | 169 | nlh->nlmsg_seq = seq; |
170 | return nlh; | 170 | return nlh; |
171 | } | 171 | } |
172 | 172 | ||
173 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | 173 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ |
174 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ | 174 | ({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \ |
175 | goto nlmsg_failure; \ | 175 | goto nlmsg_failure; \ |
176 | __nlmsg_put(skb, pid, seq, type, len); }) | 176 | __nlmsg_put(skb, pid, seq, type, len, flags); }) |
177 | |||
178 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | ||
179 | NLMSG_NEW(skb, pid, seq, type, len, 0) | ||
177 | 180 | ||
178 | #define NLMSG_PUT_ANSWER(skb, cb, type, len) \ | 181 | #define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \ |
179 | NLMSG_PUT(skb, NETLINK_CB((cb)->skb).pid, \ | 182 | NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \ |
180 | (cb)->nlh->nlmsg_seq, type, len) | 183 | (cb)->nlh->nlmsg_seq, type, len, flags) |
181 | 184 | ||
182 | #define NLMSG_END(skb, nlh) \ | 185 | #define NLMSG_END(skb, nlh) \ |
183 | ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ | 186 | ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ |