diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-19 18:33:04 -0400 |
|---|---|---|
| committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:41 -0400 |
| commit | 98e399f82ab3a6d863d1d4a7ea48925cc91c830e (patch) | |
| tree | 5f84043aeec1ec27c2e8e6cc25b5d2e6c3d07343 /net/packet | |
| parent | 31713c333ddbb66d694829082620b69b71c4b09a (diff) | |
[SK_BUFF]: Introduce skb_mac_header()
For the places where we need a pointer to the mac header, it is still legal to
touch skb->mac.raw directly if just adding to, subtracting from or setting it
to another layer header.
This one also converts some more cases to skb_reset_mac_header() that my
regex missed as it had no spaces before nor after '=', ugh.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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, 4 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 6f8c72d2413b..73cb2d3e27d2 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -284,7 +284,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct | |||
| 284 | * Incoming packets have ll header pulled, | 284 | * Incoming packets have ll header pulled, |
| 285 | * push it back. | 285 | * push it back. |
| 286 | * | 286 | * |
| 287 | * For outgoing ones skb->data == skb->mac.raw | 287 | * For outgoing ones skb->data == skb_mac_header(skb) |
| 288 | * so that this procedure is noop. | 288 | * so that this procedure is noop. |
| 289 | */ | 289 | */ |
| 290 | 290 | ||
| @@ -303,7 +303,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct | |||
| 303 | 303 | ||
| 304 | spkt = &PACKET_SKB_CB(skb)->sa.pkt; | 304 | spkt = &PACKET_SKB_CB(skb)->sa.pkt; |
| 305 | 305 | ||
| 306 | skb_push(skb, skb->data-skb->mac.raw); | 306 | skb_push(skb, skb->data - skb_mac_header(skb)); |
| 307 | 307 | ||
| 308 | /* | 308 | /* |
| 309 | * The SOCK_PACKET socket receives _all_ frames. | 309 | * The SOCK_PACKET socket receives _all_ frames. |
| @@ -488,7 +488,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet | |||
| 488 | never delivered to user. | 488 | never delivered to user. |
| 489 | */ | 489 | */ |
| 490 | if (sk->sk_type != SOCK_DGRAM) | 490 | if (sk->sk_type != SOCK_DGRAM) |
| 491 | skb_push(skb, skb->data - skb->mac.raw); | 491 | skb_push(skb, skb->data - skb_mac_header(skb)); |
| 492 | else if (skb->pkt_type == PACKET_OUTGOING) { | 492 | else if (skb->pkt_type == PACKET_OUTGOING) { |
| 493 | /* Special case: outgoing packets have ll header at head */ | 493 | /* Special case: outgoing packets have ll header at head */ |
| 494 | skb_pull(skb, skb->nh.raw - skb->data); | 494 | skb_pull(skb, skb->nh.raw - skb->data); |
| @@ -592,7 +592,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
| 592 | 592 | ||
| 593 | if (dev->hard_header) { | 593 | if (dev->hard_header) { |
| 594 | if (sk->sk_type != SOCK_DGRAM) | 594 | if (sk->sk_type != SOCK_DGRAM) |
| 595 | skb_push(skb, skb->data - skb->mac.raw); | 595 | skb_push(skb, skb->data - skb_mac_header(skb)); |
| 596 | else if (skb->pkt_type == PACKET_OUTGOING) { | 596 | else if (skb->pkt_type == PACKET_OUTGOING) { |
| 597 | /* Special case: outgoing packets have ll header at head */ | 597 | /* Special case: outgoing packets have ll header at head */ |
| 598 | skb_pull(skb, skb->nh.raw - skb->data); | 598 | skb_pull(skb, skb->nh.raw - skb->data); |
