FreeBSD/sys/netinet6/nd6_rtr.c
/*
 * for default router selection
 * regards router-preference field as a 2-bit signed integer
 */
for default router selection
regards router-preference field as a 2-bit signed integer
for default router selection regards router - preference field as a 2 - bit signed integer
static int
rtpref(struct nd_defrouter *dr)
{
	switch (dr->raflags & ND_RA_FLAG_RTPREF_MASK) {
	case ND_RA_FLAG_RTPREF_HIGH:
		return (RTPREF_HIGH);
	case ND_RA_FLAG_RTPREF_MEDIUM:
	case ND_RA_FLAG_RTPREF_RSV:
		return (RTPREF_MEDIUM);
	case ND_RA_FLAG_RTPREF_LOW:
		return (RTPREF_LOW);
	default:
		log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->raflags);
		return (RTPREF_INVALID);
	}
}
static int rtpref ( struct nd_defrouter * dr ) { switch ( dr -> raflags & ND_RA_FLAG_RTPREF_MASK ) { case ND_RA_FLAG_RTPREF_HIGH : return ( RTPREF_HIGH ) ; case ND_RA_FLAG_RTPREF_MEDIUM : case ND_RA_FLAG_RTPREF_RSV : return ( RTPREF_MEDIUM ) ; case ND_RA_FLAG_RTPREF_LOW : return ( RTPREF_LOW ) ; default : log ( LOG_ERR , " \n " , dr -> raflags ) ; return ( RTPREF_INVALID ) ; } }
for default router selection
 regards router-preference field as a 2-bit signed integer
for default router selection regards router - preference field as a 2 - bit signed integer
/*
		 * This case should never happen.  If it did, it would mean a
		 * serious bug of kernel internal.  We thus always bark here.
		 * Or, can we even panic?
		 */ /* NOTREACHED */