Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/icmp6.c
Show First 20 Lines • Show All 1,105 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) | icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int validated) | ||||
{ | { | ||||
struct in6_addr *dst = ip6cp->ip6c_finaldst; | struct in6_addr *dst = ip6cp->ip6c_finaldst; | ||||
struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6; | struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6; | ||||
struct mbuf *m = ip6cp->ip6c_m; /* will be necessary for scope issue */ | struct mbuf *m = ip6cp->ip6c_m; /* will be necessary for scope issue */ | ||||
u_int mtu = ntohl(icmp6->icmp6_mtu); | u_int mtu = ntohl(icmp6->icmp6_mtu); | ||||
struct in_conninfo inc; | struct in_conninfo inc; | ||||
uint32_t max_mtu; | |||||
#if 0 | #if 0 | ||||
/* | /* | ||||
* RFC2460 section 5, last paragraph. | * RFC2460 section 5, last paragraph. | ||||
* even though minimum link MTU for IPv6 is IPV6_MMTU, | * even though minimum link MTU for IPv6 is IPV6_MMTU, | ||||
* we may see ICMPv6 too big with mtu < IPV6_MMTU | * we may see ICMPv6 too big with mtu < IPV6_MMTU | ||||
* due to packet translator in the middle. | * due to packet translator in the middle. | ||||
* see ip6_output() and ip6_getpmtu() "alwaysfrag" case for | * see ip6_output() and ip6_getpmtu() "alwaysfrag" case for | ||||
Show All 24 Lines | #endif | ||||
bzero(&inc, sizeof(inc)); | bzero(&inc, sizeof(inc)); | ||||
inc.inc_fibnum = M_GETFIB(m); | inc.inc_fibnum = M_GETFIB(m); | ||||
inc.inc_flags |= INC_ISIPV6; | inc.inc_flags |= INC_ISIPV6; | ||||
inc.inc6_faddr = *dst; | inc.inc6_faddr = *dst; | ||||
if (in6_setscope(&inc.inc6_faddr, m->m_pkthdr.rcvif, NULL)) | if (in6_setscope(&inc.inc6_faddr, m->m_pkthdr.rcvif, NULL)) | ||||
return; | return; | ||||
if (mtu < tcp_maxmtu6(&inc, NULL)) { | max_mtu = tcp_hc_getmtu(&inc); | ||||
if (max_mtu == 0) | |||||
max_mtu = tcp_maxmtu6(&inc, NULL); | |||||
if (mtu < max_mtu) { | |||||
tcp_hc_updatemtu(&inc, mtu); | tcp_hc_updatemtu(&inc, mtu); | ||||
ICMP6STAT_INC(icp6s_pmtuchg); | ICMP6STAT_INC(icp6s_pmtuchg); | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Process a Node Information Query packet, based on | * Process a Node Information Query packet, based on | ||||
* draft-ietf-ipngwg-icmp-name-lookups-07. | * draft-ietf-ipngwg-icmp-name-lookups-07. | ||||
▲ Show 20 Lines • Show All 1,595 Lines • Show Last 20 Lines |