Author: ae
Date: Thu Apr 12 21:29:40 2018
New Revision: 332459
URL: https://svnweb.freebsd.org/changeset/base/332459

Log:
  Fix integer types mismatch for flags field in nat64stl_cfg structure.
  
  Also preserve internal flags on NAT64STL reconfiguration.
  
  Obtained from:        Yandex LLC
  MFC after:    1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/nat64/nat64stl.h
  head/sys/netpfil/ipfw/nat64/nat64stl_control.c

Modified: head/sys/netpfil/ipfw/nat64/nat64stl.h
==============================================================================
--- head/sys/netpfil/ipfw/nat64/nat64stl.h      Thu Apr 12 21:21:18 2018        
(r332458)
+++ head/sys/netpfil/ipfw/nat64/nat64stl.h      Thu Apr 12 21:29:40 2018        
(r332459)
@@ -38,7 +38,7 @@ struct nat64stl_cfg {
 
        struct in6_addr         prefix6;/* IPv6 prefix */
        uint8_t                 plen6;  /* prefix length */
-       uint8_t                 flags;  /* flags for internal use */
+       uint32_t                flags;  /* flags for internal use */
 #define        NAT64STL_KIDX           0x0100
 #define        NAT64STL_46T            0x0200
 #define        NAT64STL_64T            0x0400

Modified: head/sys/netpfil/ipfw/nat64/nat64stl_control.c
==============================================================================
--- head/sys/netpfil/ipfw/nat64/nat64stl_control.c      Thu Apr 12 21:21:18 
2018        (r332458)
+++ head/sys/netpfil/ipfw/nat64/nat64stl_control.c      Thu Apr 12 21:29:40 
2018        (r332459)
@@ -289,8 +289,8 @@ nat64stl_config(struct ip_fw_chain *ch, ip_fw3_opheade
         * For now allow to change only following values:
         *  flags.
         */
-
-       cfg->flags = uc->flags & NAT64STL_FLAGSMASK;
+       cfg->flags &= ~NAT64STL_FLAGSMASK;
+       cfg->flags |= uc->flags & NAT64STL_FLAGSMASK;
        IPFW_UH_WUNLOCK(ch);
        return (0);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to