kernels/linux-2.4.0/net/ipv6/ndisc.c
/* Called with locked neigh: either read or both */
Called with locked neigh: either read or both
Called with locked neigh : either read or both
static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
{
	struct in6_addr *saddr = NULL;
	struct in6_addr mcaddr;
	struct net_device *dev = neigh->dev;
	struct in6_addr *target = (struct in6_addr *)&neigh->primary_key;
	int probes = atomic_read(&neigh->probes);
	if (skb && ipv6_chk_addr(&skb->nh.ipv6h->saddr, dev))
		saddr = &skb->nh.ipv6h->saddr;
	if ((probes -= neigh->parms->ucast_probes) < 0) {
		if (!(neigh->nud_state&NUD_VALID))
			ND_PRINTK1("trying to ucast probe in NUD_INVALID\n");
		ndisc_send_ns(dev, neigh, target, target, saddr);
	} else if ((probes -= neigh->parms->app_probes) < 0) {
#ifdef CONFIG_ARPD
		neigh_app_ns(neigh);
#endif
	} else {
#ifdef CONFIG_IPV6_EUI64
		addrconf_addr_solict_mult_new(target, &mcaddr);
		ndisc_send_ns(dev, NULL, target, &mcaddr, saddr);
#endif
#ifndef CONFIG_IPV6_NO_PB
		addrconf_addr_solict_mult_old(target, &mcaddr);
		ndisc_send_ns(dev, NULL, target, &mcaddr, saddr);
#endif
	}
}
static void ndisc_solicit ( struct neighbour * neigh , struct sk_buff * skb ) { struct in6_addr * saddr = NULL ; struct in6_addr mcaddr ; struct net_device * dev = neigh -> dev ; struct in6_addr * target = ( struct in6_addr * ) & neigh -> primary_key ; int probes = atomic_read ( & neigh -> probes ) ; if ( skb && ipv6_chk_addr ( & skb -> nh . ipv6h -> saddr , dev ) ) saddr = & skb -> nh . ipv6h -> saddr ; if ( ( probes -= neigh -> parms -> ucast_probes ) < 0 ) { if ( ! ( neigh -> nud_state & NUD_VALID ) ) ND_PRINTK1 ( " \n " ) ; ndisc_send_ns ( dev , neigh , target , target , saddr ) ; } else if ( ( probes -= neigh -> parms -> app_probes ) < 0 ) { #ifdef CONFIG_ARPD neigh_app_ns ( neigh ) ; #endif } else { #ifdef CONFIG_IPV6_EUI64 addrconf_addr_solict_mult_new ( target , & mcaddr ) ; ndisc_send_ns ( dev , NULL , target , & mcaddr , saddr ) ; #endif #ifndef CONFIG_IPV6_NO_PB addrconf_addr_solict_mult_old ( target , & mcaddr ) ; ndisc_send_ns ( dev , NULL , target , & mcaddr , saddr ) ; #endif } }
Called with locked neigh: either read or both
Called with locked neigh : either read or both