diff options
-rw-r--r-- | net/ipv6/ndisc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 067a0d2eb557..49dfc2a73ee0 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -148,10 +148,11 @@ static inline int ndisc_opt_addr_space(struct net_device *dev) | |||
148 | return NDISC_OPT_SPACE(dev->addr_len + ndisc_addr_option_pad(dev->type)); | 148 | return NDISC_OPT_SPACE(dev->addr_len + ndisc_addr_option_pad(dev->type)); |
149 | } | 149 | } |
150 | 150 | ||
151 | static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int data_len, | 151 | static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, |
152 | unsigned short addr_type) | 152 | struct net_device *dev) |
153 | { | 153 | { |
154 | int pad = ndisc_addr_option_pad(addr_type); | 154 | int pad = ndisc_addr_option_pad(dev->type); |
155 | int data_len = dev->addr_len; | ||
155 | int space = NDISC_OPT_SPACE(data_len + pad); | 156 | int space = NDISC_OPT_SPACE(data_len + pad); |
156 | 157 | ||
157 | opt[0] = type; | 158 | opt[0] = type; |
@@ -420,8 +421,7 @@ static struct sk_buff *ndisc_build_skb(struct net_device *dev, | |||
420 | } | 421 | } |
421 | 422 | ||
422 | if (llinfo) | 423 | if (llinfo) |
423 | ndisc_fill_addr_option(opt, llinfo, dev->dev_addr, | 424 | ndisc_fill_addr_option(opt, llinfo, dev->dev_addr, dev); |
424 | dev->addr_len, dev->type); | ||
425 | 425 | ||
426 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len, | 426 | hdr->icmp6_cksum = csum_ipv6_magic(saddr, daddr, len, |
427 | IPPROTO_ICMPV6, | 427 | IPPROTO_ICMPV6, |
@@ -1469,8 +1469,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) | |||
1469 | */ | 1469 | */ |
1470 | 1470 | ||
1471 | if (ha) | 1471 | if (ha) |
1472 | opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, ha, | 1472 | opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, ha, dev); |
1473 | dev->addr_len, dev->type); | ||
1474 | 1473 | ||
1475 | /* | 1474 | /* |
1476 | * build redirect option and copy skb over to the new packet. | 1475 | * build redirect option and copy skb over to the new packet. |