sigh. why is it always that you notice you forgot to copy the last
iteration of the diff to the mail machine right AFTER hitting send?

Index: netinet/tcp_subr.c
===================================================================
RCS file: /cvs/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.125
diff -u -p -r1.125 tcp_subr.c
--- netinet/tcp_subr.c  24 Oct 2013 11:31:43 -0000      1.125
+++ netinet/tcp_subr.c  24 Jan 2014 06:34:28 -0000
@@ -319,7 +319,6 @@ tcp_respond(struct tcpcb *tp, caddr_t te
        struct route *ro = 0;
        struct tcphdr *th;
        struct ip *ip;
-       struct ipovly *ih;
 #ifdef INET6
        struct ip6_hdr *ip6;
 #endif
@@ -385,6 +384,7 @@ tcp_respond(struct tcpcb *tp, caddr_t te
        m->m_len = tlen;
        m->m_pkthdr.len = tlen;
        m->m_pkthdr.rcvif = (struct ifnet *) 0;
+       m->m_pkthdr.csum_flags |= M_TCP_CSUM_OUT;
        th->th_seq = htonl(seq);
        th->th_ack = htonl(ack);
        th->th_x2 = 0;
@@ -410,9 +410,6 @@ tcp_respond(struct tcpcb *tp, caddr_t te
                ip6->ip6_nxt  = IPPROTO_TCP;
                ip6->ip6_hlim = in6_selecthlim(tp ? tp->t_inpcb : NULL, NULL);  
/*XXX*/
                ip6->ip6_plen = tlen - sizeof(struct ip6_hdr);
-               th->th_sum = 0;
-               th->th_sum = in6_cksum(m, IPPROTO_TCP,
-                  sizeof(struct ip6_hdr), ip6->ip6_plen);
                HTONS(ip6->ip6_plen);
                ip6_output(m, tp ? tp->t_inpcb->inp_outputopts6 : NULL,
                    (struct route_in6 *)ro, 0, NULL, NULL,
@@ -420,19 +417,9 @@ tcp_respond(struct tcpcb *tp, caddr_t te
                break;
 #endif /* INET6 */
        case AF_INET:
-               ih = (struct ipovly *)ip;
-               bzero(ih->ih_x1, sizeof ih->ih_x1);
-               ih->ih_len = htons((u_short)tlen - sizeof(struct ip));
-
-               /*
-                * There's no point deferring to hardware checksum processing
-                * here, as we only send a minimal TCP packet whose checksum
-                * we need to compute in any case.
-                */
-               th->th_sum = 0;
-               th->th_sum = in_cksum(m, tlen);
                ip->ip_len = htons(tlen);
                ip->ip_ttl = ip_defttl;
+               ip->ip_tos = 0;
                ip_output(m, (void *)NULL, ro, ip_mtudisc ? IP_MTUDISC : 0,
                        (void *)NULL, tp ? tp->t_inpcb : (void *)NULL);
        }

-- 
Henning Brauer, h...@bsws.de, henn...@openbsd.org
BS Web Services GmbH, http://bsws.de, Full-Service ISP
Secure Hosting, Mail and DNS Services. Dedicated Servers, Root to Fully Managed
Henning Brauer Consulting, http://henningbrauer.com/

Reply via email to