diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-09 04:36:32 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:50 -0400 |
commit | 0c4e85813d0a94eeb8bf813397a4907bdd7bb610 (patch) | |
tree | 53ee948abc930bb1c5cd270c490f87fda5eb45b3 /net/econet | |
parent | 4c94f8c0c9a82fad84bc5df453aff755cfed70b7 (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/econet')
-rw-r--r-- | net/econet/af_econet.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 9938e76a8ff6..9cae16b4e0b7 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -336,6 +336,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
336 | /* Real hardware Econet. We're not worthy etc. */ | 336 | /* Real hardware Econet. We're not worthy etc. */ |
337 | #ifdef CONFIG_ECONET_NATIVE | 337 | #ifdef CONFIG_ECONET_NATIVE |
338 | unsigned short proto = 0; | 338 | unsigned short proto = 0; |
339 | int res; | ||
339 | 340 | ||
340 | dev_hold(dev); | 341 | dev_hold(dev); |
341 | 342 | ||
@@ -354,12 +355,12 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
354 | eb->sec = *saddr; | 355 | eb->sec = *saddr; |
355 | eb->sent = ec_tx_done; | 356 | eb->sent = ec_tx_done; |
356 | 357 | ||
357 | if (dev->hard_header) { | 358 | err = -EINVAL; |
358 | int res; | 359 | res = dev_hard_header(skb, dev, ntohs(proto), &addr, NULL, len); |
360 | if (res < 0) | ||
361 | goto out_free; | ||
362 | if (res > 0) { | ||
359 | struct ec_framehdr *fh; | 363 | struct ec_framehdr *fh; |
360 | err = -EINVAL; | ||
361 | res = dev->hard_header(skb, dev, ntohs(proto), | ||
362 | &addr, NULL, len); | ||
363 | /* Poke in our control byte and | 364 | /* Poke in our control byte and |
364 | port number. Hack, hack. */ | 365 | port number. Hack, hack. */ |
365 | fh = (struct ec_framehdr *)(skb->data); | 366 | fh = (struct ec_framehdr *)(skb->data); |
@@ -368,8 +369,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
368 | if (sock->type != SOCK_DGRAM) { | 369 | if (sock->type != SOCK_DGRAM) { |
369 | skb_reset_tail_pointer(skb); | 370 | skb_reset_tail_pointer(skb); |
370 | skb->len = 0; | 371 | skb->len = 0; |
371 | } else if (res < 0) | 372 | } |
372 | goto out_free; | ||
373 | } | 373 | } |
374 | 374 | ||
375 | /* Copy the data. Returns -EFAULT on error */ | 375 | /* Copy the data. Returns -EFAULT on error */ |