From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 4 14:10:16 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A974116A41C for ; Mon, 4 Jul 2005 14:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 802C843D53 for ; Mon, 4 Jul 2005 14:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j64EAG8c062503 for ; Mon, 4 Jul 2005 14:10:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j64EAGY2062502; Mon, 4 Jul 2005 14:10:16 GMT (envelope-from gnats) Resent-Date: Mon, 4 Jul 2005 14:10:16 GMT Resent-Message-Id: <200507041410.j64EAGY2062502@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Bjoern A. Zeeb" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39FCA16A41C for ; Mon, 4 Jul 2005 14:08:34 +0000 (GMT) (envelope-from bz@zabbadoz.net) Received: from transport.cksoft.de (transport.cksoft.de [62.111.66.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD64E43D5D for ; Mon, 4 Jul 2005 14:08:33 +0000 (GMT) (envelope-from bz@zabbadoz.net) Received: from transport.cksoft.de (localhost [127.0.0.1]) by transport.cksoft.de (Postfix) with ESMTP id 35D311FFACB for ; Mon, 4 Jul 2005 16:08:33 +0200 (CEST) Received: by transport.cksoft.de (Postfix, from userid 66) id E16C01FF9AF; Mon, 4 Jul 2005 16:08:30 +0200 (CEST) Received: by mail.int.zabbadoz.net (Postfix, from userid 1060) id A13CA157B9; Mon, 4 Jul 2005 14:08:18 +0000 (UTC) Message-Id: <20050704140818.A13CA157B9@mail.int.zabbadoz.net> Date: Mon, 4 Jul 2005 14:08:18 +0000 (UTC) From: "Bjoern A. Zeeb" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: "Bjoern A. Zeeb" Subject: bin/82975: route change does not parse classfull network as given in netstat X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Bjoern A. Zeeb" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2005 14:10:16 -0000 >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: locks: inits: sockaddrs: 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: