Lines Matching refs:neigh
75 static bool ndisc_key_eq(const struct neighbour *neigh, const void *pkey);
78 static int ndisc_constructor(struct neighbour *neigh);
79 static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb);
80 static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb);
324 static int ndisc_constructor(struct neighbour *neigh) in ndisc_constructor() argument
326 struct in6_addr *addr = (struct in6_addr *)&neigh->primary_key; in ndisc_constructor()
327 struct net_device *dev = neigh->dev; in ndisc_constructor()
338 __neigh_parms_put(neigh->parms); in ndisc_constructor()
339 neigh->parms = neigh_parms_clone(parms); in ndisc_constructor()
341 neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST; in ndisc_constructor()
343 neigh->nud_state = NUD_NOARP; in ndisc_constructor()
344 neigh->ops = &ndisc_direct_ops; in ndisc_constructor()
345 neigh->output = neigh_direct_output; in ndisc_constructor()
348 neigh->nud_state = NUD_NOARP; in ndisc_constructor()
349 ndisc_mc_map(addr, neigh->ha, dev, 1); in ndisc_constructor()
351 neigh->nud_state = NUD_NOARP; in ndisc_constructor()
352 memcpy(neigh->ha, dev->dev_addr, dev->addr_len); in ndisc_constructor()
354 neigh->type = RTN_LOCAL; in ndisc_constructor()
356 neigh->nud_state = NUD_NOARP; in ndisc_constructor()
357 memcpy(neigh->ha, dev->broadcast, dev->addr_len); in ndisc_constructor()
360 neigh->ops = &ndisc_hh_ops; in ndisc_constructor()
362 neigh->ops = &ndisc_generic_ops; in ndisc_constructor()
363 if (neigh->nud_state&NUD_VALID) in ndisc_constructor()
364 neigh->output = neigh->ops->connected_output; in ndisc_constructor()
366 neigh->output = neigh->ops->output; in ndisc_constructor()
705 static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb) in ndisc_error_report() argument
717 static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb) in ndisc_solicit() argument
721 struct net_device *dev = neigh->dev; in ndisc_solicit()
722 struct in6_addr *target = (struct in6_addr *)&neigh->primary_key; in ndisc_solicit()
723 int probes = atomic_read(&neigh->probes); in ndisc_solicit()
729 probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES); in ndisc_solicit()
731 if (!(neigh->nud_state & NUD_VALID)) { in ndisc_solicit()
737 } else if ((probes -= NEIGH_VAR(neigh->parms, APP_PROBES)) < 0) { in ndisc_solicit()
738 neigh_app_ns(neigh); in ndisc_solicit()
760 void ndisc_update(const struct net_device *dev, struct neighbour *neigh, in ndisc_update() argument
764 neigh_update(neigh, lladdr, new, flags, 0); in ndisc_update()
766 ndisc_ops_update(dev, neigh, flags, icmp6_type, ndopts); in ndisc_update()
781 struct neighbour *neigh; in ndisc_recv_ns() local
932 neigh = __neigh_lookup(&nd_tbl, saddr, dev, in ndisc_recv_ns()
934 if (neigh) in ndisc_recv_ns()
935 ndisc_update(dev, neigh, lladdr, NUD_STALE, in ndisc_recv_ns()
939 if (neigh || !dev->header_ops) { in ndisc_recv_ns()
942 if (neigh) in ndisc_recv_ns()
943 neigh_release(neigh); in ndisc_recv_ns()
965 struct neighbour *neigh; in ndisc_recv_na() local
1026 neigh = neigh_lookup(&nd_tbl, &msg->target, dev); in ndisc_recv_na()
1028 if (neigh) { in ndisc_recv_na()
1029 u8 old_flags = neigh->flags; in ndisc_recv_na()
1032 if (neigh->nud_state & NUD_FAILED) in ndisc_recv_na()
1047 ndisc_update(dev, neigh, lladdr, in ndisc_recv_na()
1055 if ((old_flags & ~neigh->flags) & NTF_ROUTER) { in ndisc_recv_na()
1063 neigh_release(neigh); in ndisc_recv_na()
1071 struct neighbour *neigh; in ndisc_recv_rs() local
1110 neigh = __neigh_lookup(&nd_tbl, saddr, skb->dev, 1); in ndisc_recv_rs()
1111 if (neigh) { in ndisc_recv_rs()
1112 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE, in ndisc_recv_rs()
1117 neigh_release(neigh); in ndisc_recv_rs()
1172 struct neighbour *neigh = NULL; in ndisc_router_discovery() local
1294 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6, in ndisc_router_discovery()
1297 if (!neigh) { in ndisc_router_discovery()
1324 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6, in ndisc_router_discovery()
1327 if (!neigh) { in ndisc_router_discovery()
1334 neigh->flags |= NTF_ROUTER; in ndisc_router_discovery()
1401 if (!neigh) in ndisc_router_discovery()
1402 neigh = __neigh_lookup(&nd_tbl, &ipv6_hdr(skb)->saddr, in ndisc_router_discovery()
1404 if (neigh) { in ndisc_router_discovery()
1415 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE, in ndisc_router_discovery()
1518 if (neigh) in ndisc_router_discovery()
1519 neigh_release(neigh); in ndisc_router_discovery()
1642 struct neighbour *neigh = dst_neigh_lookup(skb_dst(skb), target); in ndisc_send_redirect() local
1643 if (!neigh) { in ndisc_send_redirect()
1649 read_lock_bh(&neigh->lock); in ndisc_send_redirect()
1650 if (neigh->nud_state & NUD_VALID) { in ndisc_send_redirect()
1651 memcpy(ha_buf, neigh->ha, dev->addr_len); in ndisc_send_redirect()
1652 read_unlock_bh(&neigh->lock); in ndisc_send_redirect()
1654 optlen += ndisc_redirect_opt_addr_space(dev, neigh, in ndisc_send_redirect()
1658 read_unlock_bh(&neigh->lock); in ndisc_send_redirect()
1660 neigh_release(neigh); in ndisc_send_redirect()