Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/ipf/netinet Fix matching of ICMP queries wh...



details:   https://anonhg.NetBSD.org/src/rev/bd977abd9a89
branches:  trunk
changeset: 344226:bd977abd9a89
user:      khorben <khorben%NetBSD.org@localhost>
date:      Thu Mar 17 04:07:41 2016 +0000

description:
Fix matching of ICMP queries when NAT'd through IPF

This notably fixes MTU updates for hosts issueing ICMP queries through a
NAT performed by NetBSD with IPF.

diffstat:

 sys/external/bsd/ipf/netinet/ip_nat.c |  23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diffs (60 lines):

diff -r 00d816c5b928 -r bd977abd9a89 sys/external/bsd/ipf/netinet/ip_nat.c
--- a/sys/external/bsd/ipf/netinet/ip_nat.c     Thu Mar 17 03:26:15 2016 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_nat.c     Thu Mar 17 04:07:41 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.15 2015/10/06 10:21:08 prlw1 Exp $        */
+/*     $NetBSD: ip_nat.c,v 1.16 2016/03/17 04:07:41 khorben Exp $      */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -113,7 +113,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.15 2015/10/06 10:21:08 prlw1 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.16 2016/03/17 04:07:41 khorben Exp $");
 #else
 static const char sccsid[] = "@(#)ip_nat.c     1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 1.1.1.2 2012/07/22 13:45:27 darrenr Exp";
@@ -4032,13 +4032,8 @@
                dport = htons(fin->fin_data[1]);
                break;
        case IPPROTO_ICMP :
-               if (flags & IPN_ICMPERR) {
-                       sport = fin->fin_data[1];
-                       dport = 0;
-               } else {
-                       dport = fin->fin_data[1];
-                       sport = 0;
-               }
+               sport = 0;
+               dport = fin->fin_data[1];
                break;
        default :
                sport = 0;
@@ -4353,8 +4348,6 @@
        u_int hv;
 
        ifp = fin->fin_ifp;
-       sport = 0;
-       dport = 0;
 
        switch (p)
        {
@@ -4364,12 +4357,12 @@
                dport = htons(fin->fin_data[1]);
                break;
        case IPPROTO_ICMP :
-               if (flags & IPN_ICMPERR)
-                       sport = fin->fin_data[1];
-               else
-                       dport = fin->fin_data[1];
+               sport = 0;
+               dport = fin->fin_data[1];
                break;
        default :
+               sport = 0;
+               dport = 0;
                break;
        }
 



Home | Main Index | Thread Index | Old Index