diff options
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r-- | net/ipv4/inet_diag.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 238999e6e871..62c2e9f7e11f 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <net/inet_hashtables.h> | 27 | #include <net/inet_hashtables.h> |
28 | #include <net/inet_timewait_sock.h> | 28 | #include <net/inet_timewait_sock.h> |
29 | #include <net/inet6_hashtables.h> | 29 | #include <net/inet6_hashtables.h> |
30 | #include <net/netlink.h> | ||
30 | 31 | ||
31 | #include <linux/inet.h> | 32 | #include <linux/inet.h> |
32 | #include <linux/stddef.h> | 33 | #include <linux/stddef.h> |
@@ -152,7 +153,7 @@ static int inet_csk_diag_fill(struct sock *sk, | |||
152 | 153 | ||
153 | rtattr_failure: | 154 | rtattr_failure: |
154 | nlmsg_failure: | 155 | nlmsg_failure: |
155 | skb_trim(skb, b - skb->data); | 156 | nlmsg_trim(skb, b); |
156 | return -EMSGSIZE; | 157 | return -EMSGSIZE; |
157 | } | 158 | } |
158 | 159 | ||
@@ -208,7 +209,7 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, | |||
208 | nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail; | 209 | nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail; |
209 | return skb->len; | 210 | return skb->len; |
210 | nlmsg_failure: | 211 | nlmsg_failure: |
211 | skb_trim(skb, previous_tail - skb->data); | 212 | nlmsg_trim(skb, previous_tail); |
212 | return -EMSGSIZE; | 213 | return -EMSGSIZE; |
213 | } | 214 | } |
214 | 215 | ||
@@ -579,7 +580,7 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, | |||
579 | return skb->len; | 580 | return skb->len; |
580 | 581 | ||
581 | nlmsg_failure: | 582 | nlmsg_failure: |
582 | skb_trim(skb, b - skb->data); | 583 | nlmsg_trim(skb, b); |
583 | return -1; | 584 | return -1; |
584 | } | 585 | } |
585 | 586 | ||