diff options
Diffstat (limited to 'net/decnet/dn_neigh.c')
-rw-r--r-- | net/decnet/dn_neigh.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c index 602dade7e9a..7f0eb087dc1 100644 --- a/net/decnet/dn_neigh.c +++ b/net/decnet/dn_neigh.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/seq_file.h> | 38 | #include <linux/seq_file.h> |
39 | #include <linux/rcupdate.h> | 39 | #include <linux/rcupdate.h> |
40 | #include <linux/jhash.h> | 40 | #include <linux/jhash.h> |
41 | #include <asm/atomic.h> | 41 | #include <linux/atomic.h> |
42 | #include <net/net_namespace.h> | 42 | #include <net/net_namespace.h> |
43 | #include <net/neighbour.h> | 43 | #include <net/neighbour.h> |
44 | #include <net/dst.h> | 44 | #include <net/dst.h> |
@@ -51,9 +51,9 @@ | |||
51 | static int dn_neigh_construct(struct neighbour *); | 51 | static int dn_neigh_construct(struct neighbour *); |
52 | static void dn_long_error_report(struct neighbour *, struct sk_buff *); | 52 | static void dn_long_error_report(struct neighbour *, struct sk_buff *); |
53 | static void dn_short_error_report(struct neighbour *, struct sk_buff *); | 53 | static void dn_short_error_report(struct neighbour *, struct sk_buff *); |
54 | static int dn_long_output(struct sk_buff *); | 54 | static int dn_long_output(struct neighbour *, struct sk_buff *); |
55 | static int dn_short_output(struct sk_buff *); | 55 | static int dn_short_output(struct neighbour *, struct sk_buff *); |
56 | static int dn_phase3_output(struct sk_buff *); | 56 | static int dn_phase3_output(struct neighbour *, struct sk_buff *); |
57 | 57 | ||
58 | 58 | ||
59 | /* | 59 | /* |
@@ -64,8 +64,6 @@ static const struct neigh_ops dn_long_ops = { | |||
64 | .error_report = dn_long_error_report, | 64 | .error_report = dn_long_error_report, |
65 | .output = dn_long_output, | 65 | .output = dn_long_output, |
66 | .connected_output = dn_long_output, | 66 | .connected_output = dn_long_output, |
67 | .hh_output = dev_queue_xmit, | ||
68 | .queue_xmit = dev_queue_xmit, | ||
69 | }; | 67 | }; |
70 | 68 | ||
71 | /* | 69 | /* |
@@ -76,8 +74,6 @@ static const struct neigh_ops dn_short_ops = { | |||
76 | .error_report = dn_short_error_report, | 74 | .error_report = dn_short_error_report, |
77 | .output = dn_short_output, | 75 | .output = dn_short_output, |
78 | .connected_output = dn_short_output, | 76 | .connected_output = dn_short_output, |
79 | .hh_output = dev_queue_xmit, | ||
80 | .queue_xmit = dev_queue_xmit, | ||
81 | }; | 77 | }; |
82 | 78 | ||
83 | /* | 79 | /* |
@@ -88,8 +84,6 @@ static const struct neigh_ops dn_phase3_ops = { | |||
88 | .error_report = dn_short_error_report, /* Can use short version here */ | 84 | .error_report = dn_short_error_report, /* Can use short version here */ |
89 | .output = dn_phase3_output, | 85 | .output = dn_phase3_output, |
90 | .connected_output = dn_phase3_output, | 86 | .connected_output = dn_phase3_output, |
91 | .hh_output = dev_queue_xmit, | ||
92 | .queue_xmit = dev_queue_xmit | ||
93 | }; | 87 | }; |
94 | 88 | ||
95 | static u32 dn_neigh_hash(const void *pkey, | 89 | static u32 dn_neigh_hash(const void *pkey, |
@@ -208,14 +202,14 @@ static int dn_neigh_output_packet(struct sk_buff *skb) | |||
208 | { | 202 | { |
209 | struct dst_entry *dst = skb_dst(skb); | 203 | struct dst_entry *dst = skb_dst(skb); |
210 | struct dn_route *rt = (struct dn_route *)dst; | 204 | struct dn_route *rt = (struct dn_route *)dst; |
211 | struct neighbour *neigh = dst->neighbour; | 205 | struct neighbour *neigh = dst_get_neighbour(dst); |
212 | struct net_device *dev = neigh->dev; | 206 | struct net_device *dev = neigh->dev; |
213 | char mac_addr[ETH_ALEN]; | 207 | char mac_addr[ETH_ALEN]; |
214 | 208 | ||
215 | dn_dn2eth(mac_addr, rt->rt_local_src); | 209 | dn_dn2eth(mac_addr, rt->rt_local_src); |
216 | if (dev_hard_header(skb, dev, ntohs(skb->protocol), neigh->ha, | 210 | if (dev_hard_header(skb, dev, ntohs(skb->protocol), neigh->ha, |
217 | mac_addr, skb->len) >= 0) | 211 | mac_addr, skb->len) >= 0) |
218 | return neigh->ops->queue_xmit(skb); | 212 | return dev_queue_xmit(skb); |
219 | 213 | ||
220 | if (net_ratelimit()) | 214 | if (net_ratelimit()) |
221 | printk(KERN_DEBUG "dn_neigh_output_packet: oops, can't send packet\n"); | 215 | printk(KERN_DEBUG "dn_neigh_output_packet: oops, can't send packet\n"); |
@@ -224,10 +218,8 @@ static int dn_neigh_output_packet(struct sk_buff *skb) | |||
224 | return -EINVAL; | 218 | return -EINVAL; |
225 | } | 219 | } |
226 | 220 | ||
227 | static int dn_long_output(struct sk_buff *skb) | 221 | static int dn_long_output(struct neighbour *neigh, struct sk_buff *skb) |
228 | { | 222 | { |
229 | struct dst_entry *dst = skb_dst(skb); | ||
230 | struct neighbour *neigh = dst->neighbour; | ||
231 | struct net_device *dev = neigh->dev; | 223 | struct net_device *dev = neigh->dev; |
232 | int headroom = dev->hard_header_len + sizeof(struct dn_long_packet) + 3; | 224 | int headroom = dev->hard_header_len + sizeof(struct dn_long_packet) + 3; |
233 | unsigned char *data; | 225 | unsigned char *data; |
@@ -271,10 +263,8 @@ static int dn_long_output(struct sk_buff *skb) | |||
271 | neigh->dev, dn_neigh_output_packet); | 263 | neigh->dev, dn_neigh_output_packet); |
272 | } | 264 | } |
273 | 265 | ||
274 | static int dn_short_output(struct sk_buff *skb) | 266 | static int dn_short_output(struct neighbour *neigh, struct sk_buff *skb) |
275 | { | 267 | { |
276 | struct dst_entry *dst = skb_dst(skb); | ||
277 | struct neighbour *neigh = dst->neighbour; | ||
278 | struct net_device *dev = neigh->dev; | 268 | struct net_device *dev = neigh->dev; |
279 | int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2; | 269 | int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2; |
280 | struct dn_short_packet *sp; | 270 | struct dn_short_packet *sp; |
@@ -315,10 +305,8 @@ static int dn_short_output(struct sk_buff *skb) | |||
315 | * Phase 3 output is the same is short output, execpt that | 305 | * Phase 3 output is the same is short output, execpt that |
316 | * it clears the area bits before transmission. | 306 | * it clears the area bits before transmission. |
317 | */ | 307 | */ |
318 | static int dn_phase3_output(struct sk_buff *skb) | 308 | static int dn_phase3_output(struct neighbour *neigh, struct sk_buff *skb) |
319 | { | 309 | { |
320 | struct dst_entry *dst = skb_dst(skb); | ||
321 | struct neighbour *neigh = dst->neighbour; | ||
322 | struct net_device *dev = neigh->dev; | 310 | struct net_device *dev = neigh->dev; |
323 | int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2; | 311 | int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2; |
324 | struct dn_short_packet *sp; | 312 | struct dn_short_packet *sp; |
@@ -404,13 +392,13 @@ int dn_neigh_router_hello(struct sk_buff *skb) | |||
404 | 392 | ||
405 | dn->flags &= ~DN_NDFLAG_P3; | 393 | dn->flags &= ~DN_NDFLAG_P3; |
406 | 394 | ||
407 | switch(msg->iinfo & DN_RT_INFO_TYPE) { | 395 | switch (msg->iinfo & DN_RT_INFO_TYPE) { |
408 | case DN_RT_INFO_L1RT: | 396 | case DN_RT_INFO_L1RT: |
409 | dn->flags &=~DN_NDFLAG_R2; | 397 | dn->flags &=~DN_NDFLAG_R2; |
410 | dn->flags |= DN_NDFLAG_R1; | 398 | dn->flags |= DN_NDFLAG_R1; |
411 | break; | 399 | break; |
412 | case DN_RT_INFO_L2RT: | 400 | case DN_RT_INFO_L2RT: |
413 | dn->flags |= DN_NDFLAG_R2; | 401 | dn->flags |= DN_NDFLAG_R2; |
414 | } | 402 | } |
415 | } | 403 | } |
416 | 404 | ||