FreeBSD/sys/netinet6/nd6_rtr.c
/*
 * Remove the default route for a given router.
 * This is just a subroutine function for defrouter_select(), and should
 * not be called from anywhere else.
 */
Remove the default route for a given router.
This is just a subroutine function for defrouter_select(), and should
not be called from anywhere else.
Remove the default route for a given router . This is just a subroutine function for defrouter_select () and should not be called from anywhere else .
static void
defrouter_delreq(struct nd_defrouter *dr)
{
	struct sockaddr_in6 def, mask, gate;
	struct rtentry *oldrt = NULL;
	bzero(&def, sizeof(def));
	bzero(&mask, sizeof(mask));
	bzero(&gate, sizeof(gate));
	def.sin6_len = mask.sin6_len = gate.sin6_len =
	    sizeof(struct sockaddr_in6);
	def.sin6_family = gate.sin6_family = AF_INET6;
	gate.sin6_addr = dr->rtaddr;
	in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def,
	    (struct sockaddr *)&gate,
	    (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, RT_DEFAULT_FIB);
	if (oldrt) {
		nd6_rtmsg(RTM_DELETE, oldrt);
		RTFREE(oldrt);
	}
	dr->installed = 0;
}
static void defrouter_delreq ( struct nd_defrouter * dr ) { struct sockaddr_in6 def , mask , gate ; struct rtentry * oldrt = NULL ; bzero ( & def , sizeof ( def ) ) ; bzero ( & mask , sizeof ( mask ) ) ; bzero ( & gate , sizeof ( gate ) ) ; def . sin6_len = mask . sin6_len = gate . sin6_len = sizeof ( struct sockaddr_in6 ) ; def . sin6_family = gate . sin6_family = AF_INET6 ; gate . sin6_addr = dr -> rtaddr ; in6_rtrequest ( RTM_DELETE , ( struct sockaddr * ) & def , ( struct sockaddr * ) & gate , ( struct sockaddr * ) & mask , RTF_GATEWAY , & oldrt , RT_DEFAULT_FIB ) ; if ( oldrt ) { nd6_rtmsg ( RTM_DELETE , oldrt ) ; RTFREE ( oldrt ) ; } dr -> installed = 0 ; }
Remove the default route for a given router.
Remove the default route for a given router .