diff options
author | andre <andre@FreeBSD.org> | 2004-01-08 11:17:11 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-01-08 11:17:11 +0000 |
commit | 09dcc2c21ce1f9c3b129150c555bd02cfebf2917 (patch) | |
tree | f34b6055d8c4aec2a13b86b6e14165a697b65cea | |
parent | e694e9332ef1442bbd5603d06948d61dd88dedd0 (diff) | |
download | FreeBSD-src-09dcc2c21ce1f9c3b129150c555bd02cfebf2917.zip FreeBSD-src-09dcc2c21ce1f9c3b129150c555bd02cfebf2917.tar.gz |
If path mtu discovery is enabled set the DF bit in all cases we
send packets on a tcp connection.
PR: kern/60889
Tested by: Richard Wendland <richard@wendland.org.uk>
Approved by: re (scottl)
-rw-r--r-- | sys/netinet/tcp_subr.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index df941d5..60709fe 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -459,6 +459,8 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) tlen += sizeof (struct tcpiphdr); ip->ip_len = tlen; ip->ip_ttl = ip_defttl; + if (path_mtu_discovery) + ip->ip_off |= IP_DF; } m->m_len = tlen; m->m_pkthdr.len = tlen; @@ -1733,6 +1735,8 @@ tcp_twrespond(struct tcptw *tw, struct socket *so, struct mbuf *msrc, m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); ip->ip_len = m->m_pkthdr.len; + if (path_mtu_discovery) + ip->ip_off |= IP_DF; error = ip_output(m, inp->inp_options, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, inp); } diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index df941d5..60709fe 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -459,6 +459,8 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) tlen += sizeof (struct tcpiphdr); ip->ip_len = tlen; ip->ip_ttl = ip_defttl; + if (path_mtu_discovery) + ip->ip_off |= IP_DF; } m->m_len = tlen; m->m_pkthdr.len = tlen; @@ -1733,6 +1735,8 @@ tcp_twrespond(struct tcptw *tw, struct socket *so, struct mbuf *msrc, m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); ip->ip_len = m->m_pkthdr.len; + if (path_mtu_discovery) + ip->ip_off |= IP_DF; error = ip_output(m, inp->inp_options, NULL, (tw->tw_so_options & SO_DONTROUTE), NULL, inp); } |