Lines Matching refs:neigh
53 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb);
72 static bool dn_key_eq(const struct neighbour *neigh, const void *pkey) in dn_key_eq() argument
74 return neigh_key_eq16(neigh, pkey); in dn_key_eq()
110 static int dn_neigh_construct(struct neighbour *neigh) in dn_neigh_construct() argument
112 struct net_device *dev = neigh->dev; in dn_neigh_construct()
113 struct dn_neigh *dn = (struct dn_neigh *)neigh; in dn_neigh_construct()
130 __neigh_parms_put(neigh->parms); in dn_neigh_construct()
131 neigh->parms = neigh_parms_clone(parms); in dn_neigh_construct()
134 neigh->ops = &dn_neigh_ops; in dn_neigh_construct()
135 neigh->nud_state = NUD_NOARP; in dn_neigh_construct()
136 neigh->output = neigh->ops->connected_output; in dn_neigh_construct()
139 memcpy(neigh->ha, dev->broadcast, dev->addr_len); in dn_neigh_construct()
141 dn_dn2eth(neigh->ha, dn->addr); in dn_neigh_construct()
166 static void dn_neigh_error_report(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_error_report() argument
172 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_output() argument
176 struct net_device *dev = neigh->dev; in dn_neigh_output()
183 seq = read_seqbegin(&neigh->ha_lock); in dn_neigh_output()
185 neigh->ha, mac_addr, skb->len); in dn_neigh_output()
186 } while (read_seqretry(&neigh->ha_lock, seq)); in dn_neigh_output()
201 struct neighbour *neigh = rt->n; in dn_neigh_output_packet() local
203 return neigh->output(neigh, skb); in dn_neigh_output_packet()
209 static int dn_long_output(struct neighbour *neigh, struct sock *sk, in dn_long_output() argument
212 struct net_device *dev = neigh->dev; in dn_long_output()
250 NULL, neigh->dev, dn_neigh_output_packet); in dn_long_output()
256 static int dn_short_output(struct neighbour *neigh, struct sock *sk, in dn_short_output() argument
259 struct net_device *dev = neigh->dev; in dn_short_output()
290 NULL, neigh->dev, dn_neigh_output_packet); in dn_short_output()
298 static int dn_phase3_output(struct neighbour *neigh, struct sock *sk, in dn_phase3_output() argument
301 struct net_device *dev = neigh->dev; in dn_phase3_output()
331 NULL, neigh->dev, dn_neigh_output_packet); in dn_phase3_output()
338 struct neighbour *neigh = rt->n; in dn_to_neigh_output() local
339 struct dn_neigh *dn = (struct dn_neigh *)neigh; in dn_to_neigh_output()
344 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_to_neigh_output()
353 return dn_phase3_output(neigh, sk, skb); in dn_to_neigh_output()
355 return dn_long_output(neigh, sk, skb); in dn_to_neigh_output()
357 return dn_short_output(neigh, sk, skb); in dn_to_neigh_output()
382 struct neighbour *neigh; in dn_neigh_router_hello() local
389 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_router_hello()
391 dn = (struct dn_neigh *)neigh; in dn_neigh_router_hello()
393 if (neigh) { in dn_neigh_router_hello()
394 write_lock(&neigh->lock); in dn_neigh_router_hello()
396 neigh->used = jiffies; in dn_neigh_router_hello()
397 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_neigh_router_hello()
399 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_router_hello()
400 neigh->updated = jiffies; in dn_neigh_router_hello()
402 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_router_hello()
403 memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_router_hello()
423 dn_db->router = neigh_clone(neigh); in dn_neigh_router_hello()
426 neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); in dn_neigh_router_hello()
429 write_unlock(&neigh->lock); in dn_neigh_router_hello()
430 neigh_release(neigh); in dn_neigh_router_hello()
443 struct neighbour *neigh; in dn_neigh_endnode_hello() local
449 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_endnode_hello()
451 dn = (struct dn_neigh *)neigh; in dn_neigh_endnode_hello()
453 if (neigh) { in dn_neigh_endnode_hello()
454 write_lock(&neigh->lock); in dn_neigh_endnode_hello()
456 neigh->used = jiffies; in dn_neigh_endnode_hello()
458 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_endnode_hello()
459 neigh->updated = jiffies; in dn_neigh_endnode_hello()
461 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_endnode_hello()
462 memcpy(neigh->ha, ð_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_endnode_hello()
468 write_unlock(&neigh->lock); in dn_neigh_endnode_hello()
469 neigh_release(neigh); in dn_neigh_endnode_hello()
502 static void neigh_elist_cb(struct neighbour *neigh, void *_info) in neigh_elist_cb() argument
507 if (neigh->dev != s->dev) in neigh_elist_cb()
510 dn = (struct dn_neigh *) neigh; in neigh_elist_cb()
523 *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; in neigh_elist_cb()