Lines Matching defs: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);
325 static int ndisc_constructor(struct neighbour *neigh)
327 struct in6_addr *addr = (struct in6_addr *)&neigh->primary_key;
328 struct net_device *dev = neigh->dev;
339 __neigh_parms_put(neigh->parms);
340 neigh->parms = neigh_parms_clone(parms);
342 neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST;
344 neigh->nud_state = NUD_NOARP;
345 neigh->ops = &ndisc_direct_ops;
346 neigh->output = neigh_direct_output;
349 neigh->nud_state = NUD_NOARP;
350 ndisc_mc_map(addr, neigh->ha, dev, 1);
352 neigh->nud_state = NUD_NOARP;
353 memcpy(neigh->ha, dev->dev_addr, dev->addr_len);
355 neigh->type = RTN_LOCAL;
357 neigh->nud_state = NUD_NOARP;
358 memcpy(neigh->ha, dev->broadcast, dev->addr_len);
361 neigh->ops = &ndisc_hh_ops;
363 neigh->ops = &ndisc_generic_ops;
364 if (neigh->nud_state&NUD_VALID)
365 neigh->output = neigh->ops->connected_output;
367 neigh->output = neigh->ops->output;
726 static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb)
736 /* Called with locked neigh: either read or both */
738 static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
742 struct net_device *dev = neigh->dev;
743 struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
744 int probes = atomic_read(&neigh->probes);
750 probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES);
752 if (!(READ_ONCE(neigh->nud_state) & NUD_VALID)) {
757 } else if ((probes -= NEIGH_VAR(neigh->parms, APP_PROBES)) < 0) {
758 neigh_app_ns(neigh);
778 void ndisc_update(const struct net_device *dev, struct neighbour *neigh,
782 neigh_update(neigh, lladdr, new, flags, 0);
784 ndisc_ops_update(dev, neigh, flags, icmp6_type, ndopts);
799 struct neighbour *neigh;
946 neigh = __neigh_lookup(&nd_tbl, saddr, dev,
948 if (neigh)
949 ndisc_update(dev, neigh, lladdr, NUD_STALE,
953 if (neigh || !dev->header_ops) {
956 if (neigh)
957 neigh_release(neigh);
1000 struct neighbour *neigh;
1061 neigh = neigh_lookup(&nd_tbl, &msg->target, dev);
1079 if (!neigh && lladdr && idev && READ_ONCE(idev->cnf.forwarding)) {
1081 neigh = neigh_create(&nd_tbl, &msg->target, dev);
1086 if (neigh && !IS_ERR(neigh)) {
1087 u8 old_flags = neigh->flags;
1090 if (READ_ONCE(neigh->nud_state) & NUD_FAILED)
1106 ndisc_update(dev, neigh, lladdr,
1114 if ((old_flags & ~neigh->flags) & NTF_ROUTER) {
1122 neigh_release(neigh);
1131 struct neighbour *neigh;
1169 neigh = __neigh_lookup(&nd_tbl, saddr, skb->dev, 1);
1170 if (neigh) {
1171 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE,
1176 neigh_release(neigh);
1233 struct neighbour *neigh = NULL;
1348 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6,
1351 if (!neigh) {
1371 if (neigh)
1372 neigh_release(neigh);
1382 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6,
1385 if (!neigh) {
1391 neigh->flags |= NTF_ROUTER;
1465 if (!neigh)
1466 neigh = __neigh_lookup(&nd_tbl, &ipv6_hdr(skb)->saddr,
1468 if (neigh) {
1478 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE,
1593 if (neigh)
1594 neigh_release(neigh);
1714 struct neighbour *neigh = dst_neigh_lookup(skb_dst(skb), target);
1715 if (!neigh) {
1716 net_dbg_ratelimited("Redirect: no neigh for target address\n");
1720 read_lock_bh(&neigh->lock);
1721 if (neigh->nud_state & NUD_VALID) {
1722 memcpy(ha_buf, neigh->ha, dev->addr_len);
1723 read_unlock_bh(&neigh->lock);
1725 optlen += ndisc_redirect_opt_addr_space(dev, neigh,
1729 read_unlock_bh(&neigh->lock);
1731 neigh_release(neigh);
1917 pr_warn("process `%s' is using deprecated sysctl (%s) net.ipv6.neigh.%s.%s - use net.ipv6.neigh.%s.%s_ms instead\n",