diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-10 23:45:18 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:46 -0400 |
commit | c1d2bbe1cd6c7bbdc6d532cefebb66c7efb789ce (patch) | |
tree | 03a715961ba576a11cbc0e91c5d465e4c4d95d82 /net/packet/af_packet.c | |
parent | 57effc70a5be9f7804e9a99964eb7265367effca (diff) |
[SK_BUFF]: Introduce skb_reset_network_header(skb)
For the common, open coded 'skb->nh.raw = skb->data' operation, so that we can
later turn skb->nh.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.
This one touches just the most simple case, next will handle the slightly more
"complex" cases.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 73cb2d3e27d2..1225e751b3f1 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -401,14 +401,14 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock, | |||
401 | * notable one here. This should really be fixed at the driver level. | 401 | * notable one here. This should really be fixed at the driver level. |
402 | */ | 402 | */ |
403 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 403 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); |
404 | skb->nh.raw = skb->data; | 404 | skb_reset_network_header(skb); |
405 | 405 | ||
406 | /* Try to align data part correctly */ | 406 | /* Try to align data part correctly */ |
407 | if (dev->hard_header) { | 407 | if (dev->hard_header) { |
408 | skb->data -= dev->hard_header_len; | 408 | skb->data -= dev->hard_header_len; |
409 | skb->tail -= dev->hard_header_len; | 409 | skb->tail -= dev->hard_header_len; |
410 | if (len < dev->hard_header_len) | 410 | if (len < dev->hard_header_len) |
411 | skb->nh.raw = skb->data; | 411 | skb_reset_network_header(skb); |
412 | } | 412 | } |
413 | 413 | ||
414 | /* Returns -EFAULT on error */ | 414 | /* Returns -EFAULT on error */ |
@@ -768,7 +768,7 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
768 | goto out_unlock; | 768 | goto out_unlock; |
769 | 769 | ||
770 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 770 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); |
771 | skb->nh.raw = skb->data; | 771 | skb_reset_network_header(skb); |
772 | 772 | ||
773 | if (dev->hard_header) { | 773 | if (dev->hard_header) { |
774 | int res; | 774 | int res; |