From owner-freebsd-net@FreeBSD.ORG Sat Apr 11 08:50:02 2009 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31111065686 for ; Sat, 11 Apr 2009 08:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CFCDE8FC30 for ; Sat, 11 Apr 2009 08:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n3B8o2uA010511 for ; Sat, 11 Apr 2009 08:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n3B8o2ka010510; Sat, 11 Apr 2009 08:50:02 GMT (envelope-from gnats) Date: Sat, 11 Apr 2009 08:50:02 GMT Message-Id: <200904110850.n3B8o2ka010510@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Mykola Dzham Cc: Subject: Re: bin/131365: r190758 break using 0 , 0/0, 0.0.0.0/0 as alias for 'default' X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mykola Dzham List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2009 08:50:04 -0000 The following reply was made to PR bin/131365; it has been noted by GNATS. From: Mykola Dzham To: bug-followup@FreeBSD.org, rrs@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: 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@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--