summaryrefslogtreecommitdiffstats
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-09-27 07:13:38 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-11 01:52:51 +0200
commitb95cce3576813ac3f86bafa6b5daaaaf7574b0fe (patch)
tree54da3f245ee145722623a8e0eaab5fc49ea78511 /net/packet/af_packet.c
parent[NET]: Wrap netdevice hardware header creation. (diff)
downloadlinux-b95cce3576813ac3f86bafa6b5daaaaf7574b0fe.tar.xz
linux-b95cce3576813ac3f86bafa6b5daaaaf7574b0fe.zip
[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/af_packet.c')
-rw-r--r--net/packet/af_packet.c8
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
sll->sll_ifindex = orig_dev->ifindex;
else
sll->sll_ifindex = dev->ifindex;
- sll->sll_halen = 0;
- if (dev->hard_header_parse)
- sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr);
+ sll->sll_halen = dev_parse_header(skb, sll->sll_addr);
PACKET_SKB_CB(skb)->origlen = skb->len;
@@ -658,9 +656,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
h->tp_usec = tv.tv_usec;
sll = (struct sockaddr_ll*)((u8*)h + TPACKET_ALIGN(sizeof(*h)));
- sll->sll_halen = 0;
- if (dev->hard_header_parse)
- sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr);
+ sll->sll_halen = dev_parse_header(skb, sll->sll_addr);
sll->sll_family = AF_PACKET;
sll->sll_hatype = dev->type;
sll->sll_protocol = skb->protocol;