diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-03-02 01:07:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-02 16:43:40 -0500 |
commit | def6775369fab9d36817b9a6bc58cab67f53f1dc (patch) | |
tree | aa69d297f88e4e835d6b1b53114f4a4872d08da7 | |
parent | 21bfb8e93301e55760dde9f775e58fd6c4f248f8 (diff) |
neigh: Move neigh_compat_output into ax25_ip.c
The only caller is now is ax25_neigh_construct so move
neigh_compat_output into ax25_ip.c make it static and rename it
ax25_neigh_output.
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-hams@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/neighbour.h | 1 | ||||
-rw-r--r-- | net/ax25/ax25_ip.c | 18 | ||||
-rw-r--r-- | net/core/neighbour.c | 20 |
3 files changed, 16 insertions, 23 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 76f708486aae..bc66babb5f27 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -268,7 +268,6 @@ void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); | |||
268 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); | 268 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); |
269 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); | 269 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); |
270 | int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); | 270 | int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); |
271 | int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); | ||
272 | int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); | 271 | int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); |
273 | struct neighbour *neigh_event_ns(struct neigh_table *tbl, | 272 | struct neighbour *neigh_event_ns(struct neigh_table *tbl, |
274 | u8 *lladdr, void *saddr, | 273 | u8 *lladdr, void *saddr, |
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index bff12e0c9090..cc7415b33cfb 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c | |||
@@ -216,6 +216,20 @@ put: | |||
216 | return 1; | 216 | return 1; |
217 | } | 217 | } |
218 | 218 | ||
219 | static int ax25_neigh_output(struct neighbour *neigh, struct sk_buff *skb) | ||
220 | { | ||
221 | struct net_device *dev = skb->dev; | ||
222 | |||
223 | __skb_pull(skb, skb_network_offset(skb)); | ||
224 | |||
225 | if (dev_hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL, | ||
226 | skb->len) < 0 && | ||
227 | dev_rebuild_header(skb)) | ||
228 | return 0; | ||
229 | |||
230 | return dev_queue_xmit(skb); | ||
231 | } | ||
232 | |||
219 | int ax25_neigh_construct(struct neighbour *neigh) | 233 | int ax25_neigh_construct(struct neighbour *neigh) |
220 | { | 234 | { |
221 | /* This trouble could be saved if ax25 would right a proper | 235 | /* This trouble could be saved if ax25 would right a proper |
@@ -227,8 +241,8 @@ int ax25_neigh_construct(struct neighbour *neigh) | |||
227 | return -EINVAL; | 241 | return -EINVAL; |
228 | 242 | ||
229 | priv->ops = *neigh->ops; | 243 | priv->ops = *neigh->ops; |
230 | priv->ops.output = neigh_compat_output; | 244 | priv->ops.output = ax25_neigh_output; |
231 | priv->ops.connected_output = neigh_compat_output; | 245 | priv->ops.connected_output = ax25_neigh_output; |
232 | return 0; | 246 | return 0; |
233 | } | 247 | } |
234 | 248 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 70fe9e10ac86..8a319ff3e8d1 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1280,26 +1280,6 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst) | |||
1280 | write_unlock_bh(&n->lock); | 1280 | write_unlock_bh(&n->lock); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | /* This function can be used in contexts, where only old dev_queue_xmit | ||
1284 | * worked, f.e. if you want to override normal output path (eql, shaper), | ||
1285 | * but resolution is not made yet. | ||
1286 | */ | ||
1287 | |||
1288 | int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb) | ||
1289 | { | ||
1290 | struct net_device *dev = skb->dev; | ||
1291 | |||
1292 | __skb_pull(skb, skb_network_offset(skb)); | ||
1293 | |||
1294 | if (dev_hard_header(skb, dev, ntohs(skb->protocol), NULL, NULL, | ||
1295 | skb->len) < 0 && | ||
1296 | dev_rebuild_header(skb)) | ||
1297 | return 0; | ||
1298 | |||
1299 | return dev_queue_xmit(skb); | ||
1300 | } | ||
1301 | EXPORT_SYMBOL(neigh_compat_output); | ||
1302 | |||
1303 | /* Slow and careful. */ | 1283 | /* Slow and careful. */ |
1304 | 1284 | ||
1305 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb) | 1285 | int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb) |