diff options
author | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> | 2013-01-21 01:47:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-21 13:33:14 -0500 |
commit | 315ff09dbaebc6061948102d7ed8781d4ee46f36 (patch) | |
tree | 6c75732095e53482a109df9fb0b1d73885a7984c /net | |
parent | 7373470202a3c98e1a338bf1acf51247cd100868 (diff) |
ndisc: Reduce number of arguments for ndisc_fill_addr_option().
Add pointer to struct net_device (dev) and remove
data_len (= dev->addr_len) and addr_type (= dev->type).
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-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. |