diff options
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index b031cf63d6ad..cefb8e52615e 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -98,7 +98,7 @@ static const struct file_operations neigh_stat_seq_fops; | |||
98 | 98 | ||
99 | static DEFINE_RWLOCK(neigh_tbl_lock); | 99 | static DEFINE_RWLOCK(neigh_tbl_lock); |
100 | 100 | ||
101 | static int neigh_blackhole(struct sk_buff *skb) | 101 | static int neigh_blackhole(struct neighbour *neigh, struct sk_buff *skb) |
102 | { | 102 | { |
103 | kfree_skb(skb); | 103 | kfree_skb(skb); |
104 | return -ENETDOWN; | 104 | return -ENETDOWN; |
@@ -1158,7 +1158,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
1158 | /* On shaper/eql skb->dst->neighbour != neigh :( */ | 1158 | /* On shaper/eql skb->dst->neighbour != neigh :( */ |
1159 | if (skb_dst(skb) && skb_dst(skb)->neighbour) | 1159 | if (skb_dst(skb) && skb_dst(skb)->neighbour) |
1160 | n1 = skb_dst(skb)->neighbour; | 1160 | n1 = skb_dst(skb)->neighbour; |
1161 | n1->output(skb); | 1161 | n1->output(n1, skb); |
1162 | write_lock_bh(&neigh->lock); | 1162 | write_lock_bh(&neigh->lock); |
1163 | } | 1163 | } |
1164 | skb_queue_purge(&neigh->arp_queue); | 1164 | skb_queue_purge(&neigh->arp_queue); |
@@ -1214,7 +1214,7 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst) | |||
1214 | * but resolution is not made yet. | 1214 | * but resolution is not made yet. |
1215 | */ | 1215 | */ |
1216 | 1216 | ||
1217 | int neigh_compat_output(struct sk_buff *skb) | 1217 | int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb) |
1218 | { | 1218 | { |
1219 | struct net_device *dev = skb->dev; | 1219 | struct net_device *dev = skb->dev; |
1220 | 1220 | ||
@@ -1231,13 +1231,12 @@ EXPORT_SYMBOL(neigh_compat_output); | |||
1231 | 1231 | ||
1232 | /* Slow and careful. */ | 1232 | /* Slow and careful. */ |
1233 | 1233 | ||
1234 | int neigh_resolve_output(struct sk_buff *skb) | 1234 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb) |
1235 | { | 1235 | { |
1236 | struct dst_entry *dst = skb_dst(skb); | 1236 | struct dst_entry *dst = skb_dst(skb); |
1237 | struct neighbour *neigh; | ||
1238 | int rc = 0; | 1237 | int rc = 0; |
1239 | 1238 | ||
1240 | if (!dst || !(neigh = dst->neighbour)) | 1239 | if (!dst) |
1241 | goto discard; | 1240 | goto discard; |
1242 | 1241 | ||
1243 | __skb_pull(skb, skb_network_offset(skb)); | 1242 | __skb_pull(skb, skb_network_offset(skb)); |
@@ -1265,7 +1264,7 @@ out: | |||
1265 | return rc; | 1264 | return rc; |
1266 | discard: | 1265 | discard: |
1267 | NEIGH_PRINTK1("neigh_resolve_output: dst=%p neigh=%p\n", | 1266 | NEIGH_PRINTK1("neigh_resolve_output: dst=%p neigh=%p\n", |
1268 | dst, dst ? dst->neighbour : NULL); | 1267 | dst, neigh); |
1269 | out_kfree_skb: | 1268 | out_kfree_skb: |
1270 | rc = -EINVAL; | 1269 | rc = -EINVAL; |
1271 | kfree_skb(skb); | 1270 | kfree_skb(skb); |
@@ -1275,13 +1274,11 @@ EXPORT_SYMBOL(neigh_resolve_output); | |||
1275 | 1274 | ||
1276 | /* As fast as possible without hh cache */ | 1275 | /* As fast as possible without hh cache */ |
1277 | 1276 | ||
1278 | int neigh_connected_output(struct sk_buff *skb) | 1277 | int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb) |
1279 | { | 1278 | { |
1280 | int err; | ||
1281 | struct dst_entry *dst = skb_dst(skb); | ||
1282 | struct neighbour *neigh = dst->neighbour; | ||
1283 | struct net_device *dev = neigh->dev; | 1279 | struct net_device *dev = neigh->dev; |
1284 | unsigned int seq; | 1280 | unsigned int seq; |
1281 | int err; | ||
1285 | 1282 | ||
1286 | __skb_pull(skb, skb_network_offset(skb)); | 1283 | __skb_pull(skb, skb_network_offset(skb)); |
1287 | 1284 | ||
@@ -1301,6 +1298,12 @@ int neigh_connected_output(struct sk_buff *skb) | |||
1301 | } | 1298 | } |
1302 | EXPORT_SYMBOL(neigh_connected_output); | 1299 | EXPORT_SYMBOL(neigh_connected_output); |
1303 | 1300 | ||
1301 | int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb) | ||
1302 | { | ||
1303 | return dev_queue_xmit(skb); | ||
1304 | } | ||
1305 | EXPORT_SYMBOL(neigh_direct_output); | ||
1306 | |||
1304 | static void neigh_proxy_process(unsigned long arg) | 1307 | static void neigh_proxy_process(unsigned long arg) |
1305 | { | 1308 | { |
1306 | struct neigh_table *tbl = (struct neigh_table *)arg; | 1309 | struct neigh_table *tbl = (struct neigh_table *)arg; |