From owner-freebsd-bugs Fri Sep 20 12:10: 5 2002 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 7E70C37B401 for ; Fri, 20 Sep 2002 12:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD5BB43E77 for ; Fri, 20 Sep 2002 12:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8KJA2Co051856 for ; Fri, 20 Sep 2002 12:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8KJA2bn051851; Fri, 20 Sep 2002 12:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CEC337B401 for ; Fri, 20 Sep 2002 12:03:41 -0700 (PDT) Received: from scout.networkphysics.com (fw.networkphysics.com [205.158.104.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23BBC43E42 for ; Fri, 20 Sep 2002 12:03:41 -0700 (PDT) (envelope-from pavel@networkphysics.com) Received: from gt500.fractal.networkphysics.com (gt500.fractal.networkphysics.com [10.10.0.192]) by scout.networkphysics.com (8.11.5/8.11.5) with ESMTP id g8KJ3eR68476 for ; Fri, 20 Sep 2002 12:03:40 -0700 (PDT) Received: (from pavel@localhost) by gt500.fractal.networkphysics.com (8.11.1/8.11.3) id g8KJ3di37362; Fri, 20 Sep 2002 12:03:39 -0700 (PDT) Message-Id: <200209201903.g8KJ3di37362@gt500.fractal.networkphysics.com> Date: Fri, 20 Sep 2002 12:03:39 -0700 (PDT) From: pavel@networkphysics.com Reply-To: pavel@alum.mit.edu To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.2 Subject: bin/43139: /sbin/route -host option doesn't always suffice Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43139 >Category: bin >Synopsis: /sbin/route -host option doesn't always suffice >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 20 12:10:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Tom Pavel >Release: FreeBSD 4.2-RELEASE i386 >Organization: Network Physics >Environment: This bug is present even in 4.7 and -current, from what I read in the sources. >Description: The /sbin/route command tries to be clever about guessing whether arguments are hosts or nets. It uses Class A/B/C prefixes as heuristics for this. Much of this is for backwards compatibility. Nowadays, CIDR addressing is widespread. With local netmasks that are more than 8 bits, it is quite possible to end up with addresses that fail the heuristics. Therefore, the route command provides -net and -host options to force the decision. Unfortunately, the -host option does not succeed in the case of an address like A.B.C.0, where A is in the Class C space. >How-To-Repeat: transam2[269] # route -n get -host 203.2.3.0 route: writing to routing socket: No such process >Fix: Index: route.c =================================================================== RCS file: /u1/Repo/FreeBSD/sbin/route/route.c,v retrieving revision 1.5.4.1 diff -u -r1.5.4.1 route.c --- route.c 2002/08/08 20:06:33 1.5.4.1 +++ route.c 2002/09/20 18:45:57 @@ -1002,7 +1002,7 @@ if ((which != RTA_DST || forcenet == 0) && (val = inet_addr(s)) != INADDR_NONE) { su->sin.sin_addr.s_addr = val; - if (which != RTA_DST || + if (which != RTA_DST || forcehost || inet_lnaof(su->sin.sin_addr) != INADDR_ANY) return (1); else { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message