Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/ip_input.c
Show First 20 Lines • Show All 734 Lines • ▼ Show 20 Lines | #ifdef BOOTP_COMPAT | ||||
goto ours; | goto ours; | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
ia = NULL; | ia = NULL; | ||||
} | } | ||||
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { | if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { | ||||
MROUTER_RLOCK(); | MROUTER_RLOCK(); | ||||
/* Do not forward packets from IN_LINKLOCAL. */ | /* | ||||
* RFC 3927 2.7: Do not forward multicast packets from | |||||
* IN_LINKLOCAL. | |||||
*/ | |||||
if (V_ip_mrouter && !IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) { | if (V_ip_mrouter && !IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) { | ||||
/* | /* | ||||
* If we are acting as a multicast router, all | * If we are acting as a multicast router, all | ||||
* incoming multicast packets are passed to the | * incoming multicast packets are passed to the | ||||
* kernel-level multicast forwarding function. | * kernel-level multicast forwarding function. | ||||
* The packet is returned (relatively) intact; if | * The packet is returned (relatively) intact; if | ||||
* ip_mforward() returns a non-zero value, the packet | * ip_mforward() returns a non-zero value, the packet | ||||
* must be discarded, else it may be accepted below. | * must be discarded, else it may be accepted below. | ||||
Show All 23 Lines | if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { | ||||
* their own filtering and update statistics accordingly. | * their own filtering and update statistics accordingly. | ||||
*/ | */ | ||||
goto ours; | goto ours; | ||||
} | } | ||||
if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST) | if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST) | ||||
goto ours; | goto ours; | ||||
if (ip->ip_dst.s_addr == INADDR_ANY) | if (ip->ip_dst.s_addr == INADDR_ANY) | ||||
goto ours; | goto ours; | ||||
/* Do not forward packets to or from IN_LINKLOCAL. */ | /* RFC 3927 2.7: Do not forward packets to or from IN_LINKLOCAL. */ | ||||
if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) || | if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) || | ||||
IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) { | IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) { | ||||
IPSTAT_INC(ips_cantforward); | IPSTAT_INC(ips_cantforward); | ||||
m_freem(m); | m_freem(m); | ||||
return; | return; | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 642 Lines • Show Last 20 Lines |