Subject: bin/23847: route interprets cidr format destinations strangely
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/23/2003 01:15:37
>Number:         23847
>Category:       bin
>Synopsis:       route add 10.10.10/21 dest results in 10/21 to dest
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 22 23:16:00 UTC 2003
>Originator:     Jarkko Torppa
>Release:        NetBSD 1.6ZF
System: NetBSD keppi 1.6ZF NetBSD 1.6ZF (KEPPI) #34: Fri Nov 28 16:19:07 EET 2003 root@keppi:/usr/src/sys/arch/i386/compile/KEPPI i386
Architecture: i386
Machine: i386

p4 1:07 keppi[177]%ident /sbin/route
     $NetBSD: crt0.c,v 1.13 2003/07/26 19:24:27 salo Exp $
     $NetBSD: route.c,v 1.70 2003/10/01 06:24:19 itojun Exp $
     $NetBSD: show.c,v 1.21 2003/08/07 10:04:39 agc Exp $


route add of 10.10.10/21 dest results into a route to 10/21, this
is because route uses inet_addr to parse that address and it only
understands "classfull" reprensentations.

route add dest, does what is expected. But notice that
route command itself prints entries like 10.10/21 when it shows
the route table and inet_net_ntop function also creates strings
like 10.10/21.

%route add 10.10/21
add net 10.10: gateway
%route get 10/21    
   route to:
 local addr:


change route to use inet_net_pton or something else for parsing destination.