if (ip6_ins_rt(nrt, NULL, NULL)) 
if (ip6_ins_rt(nrt, NULL, NULL, NULL)) 
void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,		  struct neighbour *neigh, u8 *lladdr, int on_link){	struct rt6_info *rt, *nrt;	/* Locate old route to this destination. */	rt = rt6_lookup(dest, NULL, neigh->dev->ifindex, 1);	if (rt == NULL)		return;	if (neigh->dev != rt->rt6i_dev)		goto out;	/*	 * Current route is on-link; redirect is always invalid.	 * 	 * Seems, previous statement is not true. It could	 * be node, which looks for us as on-link (f.e. proxy ndisc)	 * But then router serving it might decide, that we should	 * know truth 8)8) --ANK (980726).	 */	if (!(rt->rt6i_flags&RTF_GATEWAY))		goto out;	/*	 *	RFC 2461 specifies that redirects should only be	 *	accepted if they come from the nexthop to the target.	 *	Due to the way default routers are chosen, this notion	 *	is a bit fuzzy and one might need to check all default	 *	routers.	 */	if (!ipv6_addr_equal(saddr, &rt->rt6i_gateway)) {		if (rt->rt6i_flags & RTF_DEFAULT) {			struct rt6_info *rt1;			read_lock(&rt6_lock);			for (rt1 = ip6_routing_table.leaf; rt1; rt1 = rt1->u.next) {				if (ipv6_addr_equal(saddr, &rt1->rt6i_gateway)) {					dst_hold(&rt1->u.dst);					dst_release(&rt->u.dst);					read_unlock(&rt6_lock);					rt = rt1;					goto source_ok;				}			}			read_unlock(&rt6_lock);		}		if (net_ratelimit())			printk(KERN_DEBUG "rt6_redirect: source isn't a valid nexthop "			       "for redirect target\n");		goto out;	}source_ok:	/*	 *	We have finally decided to accept it.	 */	neigh_update(neigh, lladdr, NUD_STALE, 		     NEIGH_UPDATE_F_WEAK_OVERRIDE|		     NEIGH_UPDATE_F_OVERRIDE|		     (on_link ? 0 : (NEIGH_UPDATE_F_OVERRIDE_ISROUTER|				     NEIGH_UPDATE_F_ISROUTER))		     );	/*	 * Redirect received -> path was valid.	 * Look, redirects are sent only in response to data packets,	 * so that this nexthop apparently is reachable. --ANK	 */	dst_confirm(&rt->u.dst);	/* Duplicate redirect: silently ignore. */	if (neigh == rt->u.dst.neighbour)		goto out;	nrt = ip6_rt_copy(rt);	if (nrt == NULL)		goto out;	nrt->rt6i_flags = RTF_GATEWAY|RTF_UP|RTF_DYNAMIC|RTF_CACHE;	if (on_link)		nrt->rt6i_flags &= ~RTF_GATEWAY;	ipv6_addr_copy(&nrt->rt6i_dst.addr, dest);	nrt->rt6i_dst.plen = 128;	nrt->u.dst.flags |= DST_HOST;	ipv6_addr_copy(&nrt->rt6i_gateway, (struct in6_addr*)neigh->primary_key);	nrt->rt6i_nexthop = neigh_clone(neigh);	/* Reset pmtu, it may be better */	nrt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(neigh->dev);	nrt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_mtu(&nrt->u.dst));	if (ip6_ins_rt(nrt, NULL, NULL))		goto out;	if (rt->rt6i_flags&RTF_CACHE) {		ip6_del_rt(rt, NULL, NULL);		return;	}out:        dst_release(&rt->u.dst);	return;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0d51aa80a9b1db43920c0770c3bb842dd823c005/route.c/buggy/net/ipv6/route.c