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 #537 NAT rules with sticky have...



details:   https://anonhg.NetBSD.org/src/rev/f83205cf484b
branches:  trunk
changeset: 330186:f83205cf484b
user:      darrenr <darrenr%NetBSD.org@localhost>
date:      Sat Jun 28 08:02:09 2014 +0000

description:
#537 NAT rules with sticky have incorrect hostmap IP address

diffstat:

 sys/external/bsd/ipf/netinet/ip_nat.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 7137d7edbd1b -r f83205cf484b sys/external/bsd/ipf/netinet/ip_nat.c
--- a/sys/external/bsd/ipf/netinet/ip_nat.c     Sat Jun 28 07:59:26 2014 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_nat.c     Sat Jun 28 08:02:09 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.11 2014/02/27 01:40:07 joerg Exp $        */
+/*     $NetBSD: ip_nat.c,v 1.12 2014/06/28 08:02:09 darrenr 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.11 2014/02/27 01:40:07 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.12 2014/06/28 08:02:09 darrenr 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";
@@ -2894,10 +2894,11 @@
         */
        if (np->in_flags & IPN_SPLIT) {
                in.s_addr = np->in_dnip;
+               inb.s_addr = htonl(in.s_addr);
 
                if ((np->in_flags & (IPN_ROUNDR|IPN_STICKY)) == IPN_STICKY) {
                        hm = ipf_nat_hostmap(softn, NULL, fin->fin_src,
-                                            fin->fin_dst, in, (u_32_t)dport);
+                                            fin->fin_dst, inb, (u_32_t)dport);
                        if (hm != NULL) {
                                in.s_addr = hm->hm_ndstip.s_addr;
                                move = 0;
@@ -3004,7 +3005,7 @@
        nat->nat_osrcip = fin->fin_src;
        if ((nat->nat_hm == NULL) && ((np->in_flags & IPN_STICKY) != 0))
                nat->nat_hm = ipf_nat_hostmap(softn, np, fin->fin_src,
-                                             fin->fin_dst, in, (u_32_t)dport);
+                                             fin->fin_dst, inb, (u_32_t)dport);
 
        if (flags & IPN_TCPUDP) {
                nat->nat_odport = dport;



Home | Main Index | Thread Index | Old Index