aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-10 20:16:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:58 -0400
commitbbe735e4247dba32568a305553b010081c8dea99 (patch)
tree95d96619c85785a47ccee48965b68d99cf946854 /net/core
parente7dd65dafda5737a983c04d652a69ab8da78ee3f (diff)
[SK_BUFF]: Introduce skb_network_offset()
For the quite common 'skb->nh.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 841e3f32cab1..c5653c512b43 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1125,7 +1125,7 @@ int neigh_compat_output(struct sk_buff *skb)
1125{ 1125{
1126 struct net_device *dev = skb->dev; 1126 struct net_device *dev = skb->dev;
1127 1127
1128 __skb_pull(skb, skb->nh.raw - skb->data); 1128 __skb_pull(skb, skb_network_offset(skb));
1129 1129
1130 if (dev->hard_header && 1130 if (dev->hard_header &&
1131 dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL, 1131 dev->hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL,
@@ -1147,7 +1147,7 @@ int neigh_resolve_output(struct sk_buff *skb)
1147 if (!dst || !(neigh = dst->neighbour)) 1147 if (!dst || !(neigh = dst->neighbour))
1148 goto discard; 1148 goto discard;
1149 1149
1150 __skb_pull(skb, skb->nh.raw - skb->data); 1150 __skb_pull(skb, skb_network_offset(skb));
1151 1151
1152 if (!neigh_event_send(neigh, skb)) { 1152 if (!neigh_event_send(neigh, skb)) {
1153 int err; 1153 int err;
@@ -1190,7 +1190,7 @@ int neigh_connected_output(struct sk_buff *skb)
1190 struct neighbour *neigh = dst->neighbour; 1190 struct neighbour *neigh = dst->neighbour;
1191 struct net_device *dev = neigh->dev; 1191 struct net_device *dev = neigh->dev;
1192 1192
1193 __skb_pull(skb, skb->nh.raw - skb->data); 1193 __skb_pull(skb, skb_network_offset(skb));
1194 1194
1195 read_lock_bh(&neigh->lock); 1195 read_lock_bh(&neigh->lock);
1196 err = dev->hard_header(skb, dev, ntohs(skb->protocol), 1196 err = dev->hard_header(skb, dev, ntohs(skb->protocol),