diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-09-27 01:13:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:51 -0400 |
commit | b95cce3576813ac3f86bafa6b5daaaaf7574b0fe (patch) | |
tree | 54da3f245ee145722623a8e0eaab5fc49ea78511 /net/packet | |
parent | 0c4e85813d0a94eeb8bf813397a4907bdd7bb610 (diff) |
[NET]: Wrap hard_header_parse
Wrap the hard_header_parse function to simplify next step of
header_ops conversion.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index c5244b309640..c9ee343c2a6c 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -519,10 +519,8 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet | |||
519 | sll->sll_ifindex = orig_dev->ifindex; | 519 | sll->sll_ifindex = orig_dev->ifindex; |
520 | else | 520 | else |
521 | sll->sll_ifindex = dev->ifindex; | 521 | sll->sll_ifindex = dev->ifindex; |
522 | sll->sll_halen = 0; | ||
523 | 522 | ||
524 | if (dev->hard_header_parse) | 523 | sll->sll_halen = dev_parse_header(skb, sll->sll_addr); |
525 | sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr); | ||
526 | 524 | ||
527 | PACKET_SKB_CB(skb)->origlen = skb->len; | 525 | PACKET_SKB_CB(skb)->origlen = skb->len; |
528 | 526 | ||
@@ -658,9 +656,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
658 | h->tp_usec = tv.tv_usec; | 656 | h->tp_usec = tv.tv_usec; |
659 | 657 | ||
660 | sll = (struct sockaddr_ll*)((u8*)h + TPACKET_ALIGN(sizeof(*h))); | 658 | sll = (struct sockaddr_ll*)((u8*)h + TPACKET_ALIGN(sizeof(*h))); |
661 | sll->sll_halen = 0; | 659 | sll->sll_halen = dev_parse_header(skb, sll->sll_addr); |
662 | if (dev->hard_header_parse) | ||
663 | sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr); | ||
664 | sll->sll_family = AF_PACKET; | 660 | sll->sll_family = AF_PACKET; |
665 | sll->sll_hatype = dev->type; | 661 | sll->sll_hatype = dev->type; |
666 | sll->sll_protocol = skb->protocol; | 662 | sll->sll_protocol = skb->protocol; |