Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 586 Lines • ▼ Show 20 Lines | if (m->m_len < *offp + sizeof(struct tcphdr)) { | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* draft-itojun-ipv6-tcp-to-anycast | * draft-itojun-ipv6-tcp-to-anycast | ||||
* better place to put this in? | * better place to put this in? | ||||
*/ | */ | ||||
ip6 = mtod(m, struct ip6_hdr *); | ip6 = mtod(m, struct ip6_hdr *); | ||||
ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); | ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */, false); | ||||
if (ia6 && (ia6->ia6_flags & IN6_IFF_ANYCAST)) { | if (ia6 && (ia6->ia6_flags & IN6_IFF_ANYCAST)) { | ||||
ifa_free(&ia6->ia_ifa); | |||||
icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, | icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, | ||||
(caddr_t)&ip6->ip6_dst - (caddr_t)ip6); | (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); | ||||
*mp = NULL; | *mp = NULL; | ||||
return (IPPROTO_DONE); | return (IPPROTO_DONE); | ||||
} | } | ||||
if (ia6) | |||||
ifa_free(&ia6->ia_ifa); | |||||
*mp = m; | *mp = m; | ||||
return (tcp_input(mp, offp, proto)); | return (tcp_input(mp, offp, proto)); | ||||
} | } | ||||
#endif /* INET6 */ | #endif /* INET6 */ | ||||
int | int | ||||
tcp_input(struct mbuf **mp, int *offp, int proto) | tcp_input(struct mbuf **mp, int *offp, int proto) | ||||
▲ Show 20 Lines • Show All 631 Lines • ▼ Show 20 Lines | #ifdef INET6 | ||||
* The wording in RFC2462 is confusing, and there are | * The wording in RFC2462 is confusing, and there are | ||||
* multiple description text for deprecated address | * multiple description text for deprecated address | ||||
* handling - worse, they are not exactly the same. | * handling - worse, they are not exactly the same. | ||||
* I believe 5.5.4 is the best one, so we follow 5.5.4. | * I believe 5.5.4 is the best one, so we follow 5.5.4. | ||||
*/ | */ | ||||
if (isipv6 && !V_ip6_use_deprecated) { | if (isipv6 && !V_ip6_use_deprecated) { | ||||
struct in6_ifaddr *ia6; | struct in6_ifaddr *ia6; | ||||
ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); | ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */, false); | ||||
if (ia6 != NULL && | if (ia6 != NULL && | ||||
(ia6->ia6_flags & IN6_IFF_DEPRECATED)) { | (ia6->ia6_flags & IN6_IFF_DEPRECATED)) { | ||||
ifa_free(&ia6->ia_ifa); | |||||
if ((s = tcp_log_addrs(&inc, th, NULL, NULL))) | if ((s = tcp_log_addrs(&inc, th, NULL, NULL))) | ||||
log(LOG_DEBUG, "%s; %s: Listen socket: " | log(LOG_DEBUG, "%s; %s: Listen socket: " | ||||
"Connection attempt to deprecated " | "Connection attempt to deprecated " | ||||
"IPv6 address rejected\n", | "IPv6 address rejected\n", | ||||
s, __func__); | s, __func__); | ||||
rstreason = BANDLIM_RST_OPENPORT; | rstreason = BANDLIM_RST_OPENPORT; | ||||
goto dropwithreset; | goto dropwithreset; | ||||
} | } | ||||
if (ia6) | |||||
ifa_free(&ia6->ia_ifa); | |||||
} | } | ||||
#endif /* INET6 */ | #endif /* INET6 */ | ||||
/* | /* | ||||
* Basic sanity checks on incoming SYN requests: | * Basic sanity checks on incoming SYN requests: | ||||
* Don't respond if the destination is a link layer | * Don't respond if the destination is a link layer | ||||
* broadcast according to RFC1122 4.2.3.10, p. 104. | * broadcast according to RFC1122 4.2.3.10, p. 104. | ||||
* If it is from this socket it must be forged. | * If it is from this socket it must be forged. | ||||
* Don't respond if the source or destination is a | * Don't respond if the source or destination is a | ||||
▲ Show 20 Lines • Show All 2,780 Lines • Show Last 20 Lines |