Lines Matching refs:neigh
125 static int dn_neigh_construct(struct neighbour *neigh) in dn_neigh_construct() argument
127 struct net_device *dev = neigh->dev; in dn_neigh_construct()
128 struct dn_neigh *dn = (struct dn_neigh *)neigh; in dn_neigh_construct()
145 __neigh_parms_put(neigh->parms); in dn_neigh_construct()
146 neigh->parms = neigh_parms_clone(parms); in dn_neigh_construct()
149 neigh->ops = &dn_long_ops; in dn_neigh_construct()
151 neigh->ops = &dn_short_ops; in dn_neigh_construct()
155 neigh->ops = &dn_phase3_ops; in dn_neigh_construct()
157 neigh->nud_state = NUD_NOARP; in dn_neigh_construct()
158 neigh->output = neigh->ops->connected_output; in dn_neigh_construct()
161 memcpy(neigh->ha, dev->broadcast, dev->addr_len); in dn_neigh_construct()
163 dn_dn2eth(neigh->ha, dn->addr); in dn_neigh_construct()
188 static void dn_long_error_report(struct neighbour *neigh, struct sk_buff *skb) in dn_long_error_report() argument
195 static void dn_short_error_report(struct neighbour *neigh, struct sk_buff *skb) in dn_short_error_report() argument
205 struct neighbour *neigh = rt->n; in dn_neigh_output_packet() local
206 struct net_device *dev = neigh->dev; in dn_neigh_output_packet()
213 seq = read_seqbegin(&neigh->ha_lock); in dn_neigh_output_packet()
215 neigh->ha, mac_addr, skb->len); in dn_neigh_output_packet()
216 } while (read_seqretry(&neigh->ha_lock, seq)); in dn_neigh_output_packet()
227 static int dn_long_output(struct neighbour *neigh, struct sk_buff *skb) in dn_long_output() argument
229 struct net_device *dev = neigh->dev; in dn_long_output()
267 neigh->dev, dn_neigh_output_packet); in dn_long_output()
270 static int dn_short_output(struct neighbour *neigh, struct sk_buff *skb) in dn_short_output() argument
272 struct net_device *dev = neigh->dev; in dn_short_output()
303 neigh->dev, dn_neigh_output_packet); in dn_short_output()
310 static int dn_phase3_output(struct neighbour *neigh, struct sk_buff *skb) in dn_phase3_output() argument
312 struct net_device *dev = neigh->dev; in dn_phase3_output()
342 neigh->dev, dn_neigh_output_packet); in dn_phase3_output()
367 struct neighbour *neigh; in dn_neigh_router_hello() local
374 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_router_hello()
376 dn = (struct dn_neigh *)neigh; in dn_neigh_router_hello()
378 if (neigh) { in dn_neigh_router_hello()
379 write_lock(&neigh->lock); in dn_neigh_router_hello()
381 neigh->used = jiffies; in dn_neigh_router_hello()
382 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_neigh_router_hello()
384 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_router_hello()
385 neigh->updated = jiffies; in dn_neigh_router_hello()
387 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_router_hello()
388 memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_router_hello()
408 dn_db->router = neigh_clone(neigh); in dn_neigh_router_hello()
411 neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); in dn_neigh_router_hello()
414 write_unlock(&neigh->lock); in dn_neigh_router_hello()
415 neigh_release(neigh); in dn_neigh_router_hello()
428 struct neighbour *neigh; in dn_neigh_endnode_hello() local
434 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_endnode_hello()
436 dn = (struct dn_neigh *)neigh; in dn_neigh_endnode_hello()
438 if (neigh) { in dn_neigh_endnode_hello()
439 write_lock(&neigh->lock); in dn_neigh_endnode_hello()
441 neigh->used = jiffies; in dn_neigh_endnode_hello()
443 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_endnode_hello()
444 neigh->updated = jiffies; in dn_neigh_endnode_hello()
446 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_endnode_hello()
447 memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_endnode_hello()
453 write_unlock(&neigh->lock); in dn_neigh_endnode_hello()
454 neigh_release(neigh); in dn_neigh_endnode_hello()
487 static void neigh_elist_cb(struct neighbour *neigh, void *_info) in neigh_elist_cb() argument
492 if (neigh->dev != s->dev) in neigh_elist_cb()
495 dn = (struct dn_neigh *) neigh; in neigh_elist_cb()
508 *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; in neigh_elist_cb()