aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-26 02:06:12 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:37 -0400
commitdc5fc579b90ed0a9a4e55b0218cdbaf0a8cf2e67 (patch)
tree673dbb425c2b09b4256ef71f89dfc5cc01944386 /net/ipv4
parenta36ca733375860b389c15ffdf6a5f92df64a33b6 (diff)
[NETLINK]: Use nlmsg_trim() where appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_diag.c7
-rw-r--r--net/ipv4/ipmr.c3
2 files changed, 6 insertions, 4 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
153rtattr_failure: 154rtattr_failure:
154nlmsg_failure: 155nlmsg_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;
210nlmsg_failure: 211nlmsg_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
581nlmsg_failure: 582nlmsg_failure:
582 skb_trim(skb, b - skb->data); 583 nlmsg_trim(skb, b);
583 return -1; 584 return -1;
584} 585}
585 586
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index ea0a491dce92..48027df5a90b 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -62,6 +62,7 @@
62#include <linux/netfilter_ipv4.h> 62#include <linux/netfilter_ipv4.h>
63#include <net/ipip.h> 63#include <net/ipip.h>
64#include <net/checksum.h> 64#include <net/checksum.h>
65#include <net/netlink.h>
65 66
66#if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2) 67#if defined(CONFIG_IP_PIMSM_V1) || defined(CONFIG_IP_PIMSM_V2)
67#define CONFIG_IP_PIMSM 1 68#define CONFIG_IP_PIMSM 1
@@ -1570,7 +1571,7 @@ ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm)
1570 return 1; 1571 return 1;
1571 1572
1572rtattr_failure: 1573rtattr_failure:
1573 skb_trim(skb, b - skb->data); 1574 nlmsg_trim(skb, b);
1574 return -EMSGSIZE; 1575 return -EMSGSIZE;
1575} 1576}
1576 1577