git: ipfw - Fix broken mixed network and host IP specifications in ip tables

Matthew Dillon dillon at crater.dragonflybsd.org
Fri Mar 11 17:16:35 PST 2022


commit 7a85cb47e3735b43552cc1131e9fe4fcb27b5428
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Fri Mar 11 17:09:48 2022 -0800

    ipfw - Fix broken mixed network and host IP specifications in ip tables
    
    * ipfw improperly assumes that the netmask sin_len is pre-zero'd, but
      prior table entries on the same command line which specify a network
      mask will leave the field non-zero for later host entries also specified
      on the command line:
    
            ipfw table 1 add 10.0.0.0/8 192.0.2.1     # 2^24 + 1 addresses
    
    	# ipfw table 1 print
    	10.0.0.0/8
    	192.0.0.0/8	<--- wrong
    
    * Fix the issue by properly initializing netmask.sin_len to 0 when a
      host IP is specified.
    
    Submitted-by: Martin Neitzel <neitzel at marshlabs.gaertner.de>

Summary of changes:
 sbin/ipfw/ipfw2.c | 3 +++
 1 file changed, 3 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7a85cb47e3735b43552cc1131e9fe4fcb27b5428


-- 
DragonFly BSD source repository



More information about the Commits mailing list