bin/131365: r190758 break using 0 , 0/0, 0.0.0.0/0 as alias for 'default'

Mykola Dzham freebsd at levsha.org.ua
Sat Apr 11 01:50:04 PDT 2009


The following reply was made to PR bin/131365; it has been noted by GNATS.

From: Mykola Dzham <freebsd at levsha.org.ua>
To: bug-followup at FreeBSD.org, rrs at FreeBSD.org
Cc:  
Subject: Re: bin/131365: r190758 break using 0 , 0/0, 0.0.0.0/0 as alias
	for 'default'
Date: Sat, 11 Apr 2009 11:20:20 +0300

 --UugvWAfsgieZRqgk
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi!
 r190758 break using 0.0.0.0/0 as alias for default rote:
 
 $ route -n get default     
    route to: default
 destination: default
        mask: default
     gateway: 192.168.1.1
   interface: em0
       flags: <UP,GATEWAY,DONE,STATIC>
  recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
        0         0         0         0         0         0      1500         0 
 
 $ route -n get -net 0.0.0.0
 route: writing to routing socket: No such process
 
 Attached patch fix this
 
 -- 
 Mykola Dzham, LEFT-(UANIC|RIPE)
 JID: levsha at jabber.net.ua
 
 --UugvWAfsgieZRqgk
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="route.c.patch"
 
 Index: route.c
 ===================================================================
 --- route.c	(revision 190880)
 +++ route.c	(working copy)
 @@ -818,7 +818,8 @@
  		/* i holds the first non zero bit */
  		bits = 32 - (i*8);	
  	}
 -	mask = 0xffffffff << (32 - bits);
 +	if (bits != 0)
 +		mask = 0xffffffff << (32 - bits);
  
  	sin->sin_addr.s_addr = htonl(addr);
  	sin = &so_mask.sin;
 
 --UugvWAfsgieZRqgk--


More information about the freebsd-net mailing list