Date: Mon, 4 Jul 2005 14:08:18 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: "Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net> Subject: bin/82975: route change does not parse classfull network as given in netstat Message-ID: <20050704140818.A13CA157B9@mail.int.zabbadoz.net> Resent-Message-ID: <200507041410.j64EAGY2062502@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 82975 >Category: bin >Synopsis: route change does not parse classfull network as given in netstat >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jul 04 14:10:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Bjoern A. Zeeb >Release: FreeBSD 6.0-CURRENT amd64 >Organization: Zabbadoz.NeT >Environment: >Description: route change of a classfull network might get parsed wrong. With netstat output of a classfull network (192.168.1.0/24) looks like this 192.168.1 192.168.64.31 UGS 0 0 em0 but route cannot correctly parse that (if not -net is given) which could lead to other bad effects. >How-To-Repeat: foo# netstat -rn -f inet | grep 192.168.1 192.168.1 192.168.64.31 UGS 0 0 em0 foo# netstat -rn -f inet | grep default default 192.168.64.1 UGS 0 27 em0 foo# route change 192.168.1 127.0.0.1 change host 192.168.1: gateway 127.0.0.1 got message of size 124 on Mon Jul 4 13:54:43 2005 RTM_CHANGE: Change Metrics or flags: len 124, pid: 55458, seq 1, errno 0, flags:<UP,GATEWAY,HOST,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY> 192.168.0.1 127.0.0.1 ^^^^^^^^^^^^^ foo# netstat -rn -f inet | grep 192.168.1 192.168.1 192.168.64.31 UGS 0 0 em0 foo# netstat -rn -f inet | grep default default 127.0.0.1 UGS 0 27 lo0 There was no error returned that the given (host) route could not be parsed correctly or found in table. Route monitor returned 192.168.0.1 instead of 196.168.1.0 (what one might expect if there is no error). The change of default route is another problem (see PR 82974). >Fix: For consitency we should either be able to parse classfull routes given (without -net) and treat them like prefixes (like -net was given and with correct addresses). Alternatively return an error like ''ENOPARSE''. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050704140818.A13CA157B9>