aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 64158353ecb2..e010ee8da41d 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -490,14 +490,10 @@ static inline struct sk_buff *nlmsg_new(size_t payload, gfp_t flags)
490 * Corrects the netlink message header to include the appeneded 490 * Corrects the netlink message header to include the appeneded
491 * attributes. Only necessary if attributes have been added to 491 * attributes. Only necessary if attributes have been added to
492 * the message. 492 * the message.
493 *
494 * Returns the total data length of the skb.
495 */ 493 */
496static inline int nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) 494static inline void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh)
497{ 495{
498 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; 496 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
499
500 return skb->len;
501} 497}
502 498
503/** 499/**
@@ -520,8 +516,10 @@ static inline void *nlmsg_get_pos(struct sk_buff *skb)
520 */ 516 */
521static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) 517static inline void nlmsg_trim(struct sk_buff *skb, const void *mark)
522{ 518{
523 if (mark) 519 if (mark) {
520 WARN_ON((unsigned char *) mark < skb->data);
524 skb_trim(skb, (unsigned char *) mark - skb->data); 521 skb_trim(skb, (unsigned char *) mark - skb->data);
522 }
525} 523}
526 524
527/** 525/**