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);
327 static int ndisc_constructor(struct neighbour *neigh)
329 struct in6_addr *addr = (struct in6_addr *)&neigh->primary_key;
330 struct net_device *dev = neigh->dev;
341 __neigh_parms_put(neigh->parms);
342 neigh->parms = neigh_parms_clone(parms);
344 neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST;
346 neigh->nud_state = NUD_NOARP;
347 neigh->ops = &ndisc_direct_ops;
348 neigh->output = neigh_direct_output;
351 neigh->nud_state = NUD_NOARP;
352 ndisc_mc_map(addr, neigh->ha, dev, 1);
354 neigh->nud_state = NUD_NOARP;
355 memcpy(neigh->ha, dev->dev_addr, dev->addr_len);
357 neigh->type = RTN_LOCAL;
359 neigh->nud_state = NUD_NOARP;
360 memcpy(neigh->ha, dev->broadcast, dev->addr_len);
363 neigh->ops = &ndisc_hh_ops;
365 neigh->ops = &ndisc_generic_ops;
366 if (neigh->nud_state&NUD_VALID)
367 neigh->output = neigh->ops->connected_output;
369 neigh->output = neigh->ops->output;
723 static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb)
733 /* Called with locked neigh: either read or both */
735 static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
739 struct net_device *dev = neigh->dev;
740 struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
741 int probes = atomic_read(&neigh->probes);
747 probes -= NEIGH_VAR(neigh->parms, UCAST_PROBES);
749 if (!(READ_ONCE(neigh->nud_state) & NUD_VALID)) {
755 } else if ((probes -= NEIGH_VAR(neigh->parms, APP_PROBES)) < 0) {
756 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;
950 neigh = __neigh_lookup(&nd_tbl, saddr, dev,
952 if (neigh)
953 ndisc_update(dev, neigh, lladdr, NUD_STALE,
957 if (neigh || !dev->header_ops) {
960 if (neigh)
961 neigh_release(neigh);
1004 struct neighbour *neigh;
1066 neigh = neigh_lookup(&nd_tbl, &msg->target, dev);
1084 if (!neigh && lladdr && idev && READ_ONCE(idev->cnf.forwarding)) {
1086 neigh = neigh_create(&nd_tbl, &msg->target, dev);
1091 if (neigh && !IS_ERR(neigh)) {
1092 u8 old_flags = neigh->flags;
1095 if (READ_ONCE(neigh->nud_state) & NUD_FAILED)
1111 ndisc_update(dev, neigh, lladdr,
1119 if ((old_flags & ~neigh->flags) & NTF_ROUTER) {
1127 neigh_release(neigh);
1136 struct neighbour *neigh;
1174 neigh = __neigh_lookup(&nd_tbl, saddr, skb->dev, 1);
1175 if (neigh) {
1176 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE,
1181 neigh_release(neigh);
1238 struct neighbour *neigh = NULL;
1361 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6,
1364 if (!neigh) {
1385 if (neigh)
1386 neigh_release(neigh);
1398 neigh = ip6_neigh_lookup(&rt->fib6_nh->fib_nh_gw6,
1401 if (!neigh) {
1408 neigh->flags |= NTF_ROUTER;
1482 if (!neigh)
1483 neigh = __neigh_lookup(&nd_tbl, &ipv6_hdr(skb)->saddr,
1485 if (neigh) {
1496 ndisc_update(skb->dev, neigh, lladdr, NUD_STALE,
1614 if (neigh)
1615 neigh_release(neigh);
1740 struct neighbour *neigh = dst_neigh_lookup(skb_dst(skb), target);
1741 if (!neigh) {
1743 "Redirect: no neigh for target address\n");
1747 read_lock_bh(&neigh->lock);
1748 if (neigh->nud_state & NUD_VALID) {
1749 memcpy(ha_buf, neigh->ha, dev->addr_len);
1750 read_unlock_bh(&neigh->lock);
1752 optlen += ndisc_redirect_opt_addr_space(dev, neigh,
1756 read_unlock_bh(&neigh->lock);
1758 neigh_release(neigh);
1946 pr_warn("process `%s' is using deprecated sysctl (%s) net.ipv6.neigh.%s.%s - use net.ipv6.neigh.%s.%s_ms instead\n",