aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-09 04:36:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:50 -0400
commit0c4e85813d0a94eeb8bf813397a4907bdd7bb610 (patch)
tree53ee948abc930bb1c5cd270c490f87fda5eb45b3 /net/ipv6/mcast.c
parent4c94f8c0c9a82fad84bc5df453aff755cfed70b7 (diff)
[NET]: Wrap netdevice hardware header creation.
Add inline for common usage of hardware header creation, and fix bug in IPV6 mcast where the assumption about negative return is an errno. Negative return from hard_header means not enough space was available,(ie -N bytes). Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 86d908b1caea..8668ab3af32e 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1438,17 +1438,12 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
1438static inline int mld_dev_queue_xmit2(struct sk_buff *skb) 1438static inline int mld_dev_queue_xmit2(struct sk_buff *skb)
1439{ 1439{
1440 struct net_device *dev = skb->dev; 1440 struct net_device *dev = skb->dev;
1441 unsigned char ha[MAX_ADDR_LEN];
1441 1442
1442 if (dev->hard_header) { 1443 ndisc_mc_map(&ipv6_hdr(skb)->daddr, ha, dev, 1);
1443 unsigned char ha[MAX_ADDR_LEN]; 1444 if (dev_hard_header(skb, dev, ETH_P_IPV6, ha, NULL, skb->len) < 0) {
1444 int err; 1445 kfree_skb(skb);
1445 1446 return -EINVAL;
1446 ndisc_mc_map(&ipv6_hdr(skb)->daddr, ha, dev, 1);
1447 err = dev->hard_header(skb, dev, ETH_P_IPV6, ha, NULL, skb->len);
1448 if (err < 0) {
1449 kfree_skb(skb);
1450 return err;
1451 }
1452 } 1447 }
1453 return dev_queue_xmit(skb); 1448 return dev_queue_xmit(skb);
1454} 1449}