Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/netinet Pull up revision 1.135 (requested by yamt in ...



details:   https://anonhg.NetBSD.org/src/rev/078f1e3acb82
branches:  netbsd-3
changeset: 575695:078f1e3acb82
user:      tron <tron%NetBSD.org@localhost>
date:      Fri May 06 08:40:21 2005 +0000

description:
Pull up revision 1.135 (requested by yamt in ticket #251):
fix problems related to loopback interface checksum omission.  PR/29971.
- for ipv4, defer decision to ip layer as h/w checksum offloading does
  so that it can check the actual interface the packet is going to.
- for ipv6, disable it.
  (maybe will be revisited when it implements h/w checksum offloading.)
ok'ed by Jason Thorpe.

diffstat:

 sys/netinet/udp_usrreq.c |  14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diffs (46 lines):

diff -r aa29ec73d43c -r 078f1e3acb82 sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c  Fri May 06 08:40:14 2005 +0000
+++ b/sys/netinet/udp_usrreq.c  Fri May 06 08:40:21 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: udp_usrreq.c,v 1.134.2.3 2005/05/01 11:03:37 tron Exp $        */
+/*     $NetBSD: udp_usrreq.c,v 1.134.2.4 2005/05/06 08:40:21 tron Exp $        */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.134.2.3 2005/05/01 11:03:37 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.134.2.4 2005/05/06 08:40:21 tron Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -146,7 +146,6 @@
 #else
 int    udpcksum = 0;           /* XXX */
 #endif
-int    udp_do_loopback_cksum = 0;
 
 struct inpcbtable udbtable;
 struct udpstat udpstat;
@@ -1080,18 +1079,11 @@
                /*
                 * XXX Cache pseudo-header checksum part for
                 * XXX "connected" UDP sockets.
-                * Maybe skip checksums on loopback interfaces.
                 */
                ui->ui_sum = in_cksum_phdr(ui->ui_src.s_addr,
                    ui->ui_dst.s_addr, htons((u_int16_t)len +
                    sizeof(struct udphdr) + IPPROTO_UDP));
-               if (__predict_true(ro->ro_rt == NULL ||
-                                  !(ro->ro_rt->rt_ifp->if_flags &
-                                    IFF_LOOPBACK) ||
-                                  udp_do_loopback_cksum))
-                       m->m_pkthdr.csum_flags = M_CSUM_UDPv4;
-               else
-                       m->m_pkthdr.csum_flags = 0;
+               m->m_pkthdr.csum_flags = M_CSUM_UDPv4;
                m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
        } else
                ui->ui_sum = 0;



Home | Main Index | Thread Index | Old Index