diff options
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 4014b623880..2720884287c 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -16,7 +16,7 @@ | |||
16 | * - Add neighbour cache statistics like rtstat | 16 | * - Add neighbour cache statistics like rtstat |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <asm/atomic.h> | 19 | #include <linux/atomic.h> |
20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
22 | #include <linux/rcupdate.h> | 22 | #include <linux/rcupdate.h> |
@@ -108,8 +108,8 @@ struct neighbour { | |||
108 | __u8 dead; | 108 | __u8 dead; |
109 | seqlock_t ha_lock; | 109 | seqlock_t ha_lock; |
110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; | 110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; |
111 | struct hh_cache *hh; | 111 | struct hh_cache hh; |
112 | int (*output)(struct sk_buff *skb); | 112 | int (*output)(struct neighbour *, struct sk_buff *); |
113 | const struct neigh_ops *ops; | 113 | const struct neigh_ops *ops; |
114 | struct rcu_head rcu; | 114 | struct rcu_head rcu; |
115 | struct net_device *dev; | 115 | struct net_device *dev; |
@@ -118,12 +118,10 @@ struct neighbour { | |||
118 | 118 | ||
119 | struct neigh_ops { | 119 | struct neigh_ops { |
120 | int family; | 120 | int family; |
121 | void (*solicit)(struct neighbour *, struct sk_buff*); | 121 | void (*solicit)(struct neighbour *, struct sk_buff *); |
122 | void (*error_report)(struct neighbour *, struct sk_buff*); | 122 | void (*error_report)(struct neighbour *, struct sk_buff *); |
123 | int (*output)(struct sk_buff*); | 123 | int (*output)(struct neighbour *, struct sk_buff *); |
124 | int (*connected_output)(struct sk_buff*); | 124 | int (*connected_output)(struct neighbour *, struct sk_buff *); |
125 | int (*hh_output)(struct sk_buff*); | ||
126 | int (*queue_xmit)(struct sk_buff*); | ||
127 | }; | 125 | }; |
128 | 126 | ||
129 | struct pneigh_entry { | 127 | struct pneigh_entry { |
@@ -142,7 +140,7 @@ struct pneigh_entry { | |||
142 | 140 | ||
143 | struct neigh_hash_table { | 141 | struct neigh_hash_table { |
144 | struct neighbour __rcu **hash_buckets; | 142 | struct neighbour __rcu **hash_buckets; |
145 | unsigned int hash_mask; | 143 | unsigned int hash_shift; |
146 | __u32 hash_rnd; | 144 | __u32 hash_rnd; |
147 | struct rcu_head rcu; | 145 | struct rcu_head rcu; |
148 | }; | 146 | }; |
@@ -205,9 +203,10 @@ extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
205 | u32 flags); | 203 | u32 flags); |
206 | extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); | 204 | extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); |
207 | extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); | 205 | extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); |
208 | extern int neigh_resolve_output(struct sk_buff *skb); | 206 | extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); |
209 | extern int neigh_connected_output(struct sk_buff *skb); | 207 | extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); |
210 | extern int neigh_compat_output(struct sk_buff *skb); | 208 | extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); |
209 | extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); | ||
211 | extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, | 210 | extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, |
212 | u8 *lladdr, void *saddr, | 211 | u8 *lladdr, void *saddr, |
213 | struct net_device *dev); | 212 | struct net_device *dev); |
@@ -341,7 +340,16 @@ static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | |||
341 | } while (read_seqretry(&hh->hh_lock, seq)); | 340 | } while (read_seqretry(&hh->hh_lock, seq)); |
342 | 341 | ||
343 | skb_push(skb, hh_len); | 342 | skb_push(skb, hh_len); |
344 | return hh->hh_output(skb); | 343 | return dev_queue_xmit(skb); |
344 | } | ||
345 | |||
346 | static inline int neigh_output(struct neighbour *n, struct sk_buff *skb) | ||
347 | { | ||
348 | struct hh_cache *hh = &n->hh; | ||
349 | if ((n->nud_state & NUD_CONNECTED) && hh->hh_len) | ||
350 | return neigh_hh_output(hh, skb); | ||
351 | else | ||
352 | return n->output(n, skb); | ||
345 | } | 353 | } |
346 | 354 | ||
347 | static inline struct neighbour * | 355 | static inline struct neighbour * |