diff options
Diffstat (limited to 'net/ax25/ax25_ip.c')
-rw-r--r-- | net/ax25/ax25_ip.c | 60 |
1 files changed, 6 insertions, 54 deletions
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index e030c64ebfb7..8b35af4ef93e 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c | |||
@@ -100,7 +100,7 @@ static int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, | |||
100 | return -AX25_HEADER_LEN; /* Unfinished header */ | 100 | return -AX25_HEADER_LEN; /* Unfinished header */ |
101 | } | 101 | } |
102 | 102 | ||
103 | static int ax25_neigh_xmit(struct sk_buff *skb) | 103 | netdev_tx_t ax25_ip_xmit(struct sk_buff *skb) |
104 | { | 104 | { |
105 | struct sk_buff *ourskb; | 105 | struct sk_buff *ourskb; |
106 | unsigned char *bp = skb->data; | 106 | unsigned char *bp = skb->data; |
@@ -210,56 +210,7 @@ put: | |||
210 | if (route) | 210 | if (route) |
211 | ax25_put_route(route); | 211 | ax25_put_route(route); |
212 | 212 | ||
213 | return 1; | 213 | return NETDEV_TX_OK; |
214 | } | ||
215 | |||
216 | static int ax25_neigh_output(struct neighbour *neigh, struct sk_buff *skb) | ||
217 | { | ||
218 | /* Except for calling ax25_neigh_xmit instead of | ||
219 | * dev_queue_xmit this is neigh_resolve_output. | ||
220 | */ | ||
221 | int rc = 0; | ||
222 | |||
223 | if (!neigh_event_send(neigh, skb)) { | ||
224 | int err; | ||
225 | struct net_device *dev = neigh->dev; | ||
226 | unsigned int seq; | ||
227 | |||
228 | do { | ||
229 | __skb_pull(skb, skb_network_offset(skb)); | ||
230 | seq = read_seqbegin(&neigh->ha_lock); | ||
231 | err = dev_hard_header(skb, dev, ntohs(skb->protocol), | ||
232 | neigh->ha, NULL, skb->len); | ||
233 | } while (read_seqretry(&neigh->ha_lock, seq)); | ||
234 | |||
235 | if (err >= 0) { | ||
236 | ax25_neigh_xmit(skb); | ||
237 | } else | ||
238 | goto out_kfree_skb; | ||
239 | } | ||
240 | out: | ||
241 | return rc; | ||
242 | |||
243 | out_kfree_skb: | ||
244 | rc = -EINVAL; | ||
245 | kfree_skb(skb); | ||
246 | goto out; | ||
247 | } | ||
248 | |||
249 | int ax25_neigh_construct(struct neighbour *neigh) | ||
250 | { | ||
251 | /* This trouble could be saved if ax25 would right a proper | ||
252 | * dev_queue_xmit function. | ||
253 | */ | ||
254 | struct ax25_neigh_priv *priv = neighbour_priv(neigh); | ||
255 | |||
256 | if (neigh->tbl->family != AF_INET) | ||
257 | return -EINVAL; | ||
258 | |||
259 | priv->ops = *neigh->ops; | ||
260 | priv->ops.output = ax25_neigh_output; | ||
261 | priv->ops.connected_output = ax25_neigh_output; | ||
262 | return 0; | ||
263 | } | 214 | } |
264 | 215 | ||
265 | #else /* INET */ | 216 | #else /* INET */ |
@@ -271,9 +222,10 @@ static int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, | |||
271 | return -AX25_HEADER_LEN; | 222 | return -AX25_HEADER_LEN; |
272 | } | 223 | } |
273 | 224 | ||
274 | int ax25_neigh_construct(struct neighbour *neigh) | 225 | netdev_tx_t ax25_ip_xmit(sturct sk_buff *skb) |
275 | { | 226 | { |
276 | return 0; | 227 | kfree_skb(skb); |
228 | return NETDEV_TX_OK; | ||
277 | } | 229 | } |
278 | #endif | 230 | #endif |
279 | 231 | ||
@@ -282,5 +234,5 @@ const struct header_ops ax25_header_ops = { | |||
282 | }; | 234 | }; |
283 | 235 | ||
284 | EXPORT_SYMBOL(ax25_header_ops); | 236 | EXPORT_SYMBOL(ax25_header_ops); |
285 | EXPORT_SYMBOL(ax25_neigh_construct); | 237 | EXPORT_SYMBOL(ax25_ip_xmit); |
286 | 238 | ||