aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_table.c')
-rw-r--r--net/decnet/dn_table.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 780a141f8342..d6615c9361e9 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -28,6 +28,7 @@
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <linux/route.h> /* RTF_xxx */ 29#include <linux/route.h> /* RTF_xxx */
30#include <net/neighbour.h> 30#include <net/neighbour.h>
31#include <net/netlink.h>
31#include <net/dst.h> 32#include <net/dst.h>
32#include <net/flow.h> 33#include <net/flow.h>
33#include <net/fib_rules.h> 34#include <net/fib_rules.h>
@@ -295,7 +296,7 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
295{ 296{
296 struct rtmsg *rtm; 297 struct rtmsg *rtm;
297 struct nlmsghdr *nlh; 298 struct nlmsghdr *nlh;
298 unsigned char *b = skb->tail; 299 unsigned char *b = skb_tail_pointer(skb);
299 300
300 nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags); 301 nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags);
301 rtm = NLMSG_DATA(nlh); 302 rtm = NLMSG_DATA(nlh);
@@ -337,19 +338,19 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
337 nhp->rtnh_ifindex = nh->nh_oif; 338 nhp->rtnh_ifindex = nh->nh_oif;
338 if (nh->nh_gw) 339 if (nh->nh_gw)
339 RTA_PUT(skb, RTA_GATEWAY, 2, &nh->nh_gw); 340 RTA_PUT(skb, RTA_GATEWAY, 2, &nh->nh_gw);
340 nhp->rtnh_len = skb->tail - (unsigned char *)nhp; 341 nhp->rtnh_len = skb_tail_pointer(skb) - (unsigned char *)nhp;
341 } endfor_nexthops(fi); 342 } endfor_nexthops(fi);
342 mp_head->rta_type = RTA_MULTIPATH; 343 mp_head->rta_type = RTA_MULTIPATH;
343 mp_head->rta_len = skb->tail - (u8*)mp_head; 344 mp_head->rta_len = skb_tail_pointer(skb) - (u8 *)mp_head;
344 } 345 }
345 346
346 nlh->nlmsg_len = skb->tail - b; 347 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
347 return skb->len; 348 return skb->len;
348 349
349 350
350nlmsg_failure: 351nlmsg_failure:
351rtattr_failure: 352rtattr_failure:
352 skb_trim(skb, b - skb->data); 353 nlmsg_trim(skb, b);
353 return -EMSGSIZE; 354 return -EMSGSIZE;
354} 355}
355 356