From owner-freebsd-bugs@freebsd.org Mon Oct 10 09:19:37 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6023DC0BB40 for ; Mon, 10 Oct 2016 09:19:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 501E6690 for ; Mon, 10 Oct 2016 09:19:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u9A9JbPk053546 for ; Mon, 10 Oct 2016 09:19:37 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 213354] route reports incorrect results Date: Mon, 10 Oct 2016 09:19:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: emz@norma.perm.ru X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 09:19:37 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213354 Bug ID: 213354 Summary: route reports incorrect results Product: Base System Version: 10.3-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: emz@norma.perm.ru Consider I have the following interface: # ifconfig gre1 gre1: flags=3D8051 metric 0 mtu 1431 options=3D80000 tunnel inet 172.16.4.28 --> 172.16.4.0 inet 172.16.0.1 --> 172.16.0.0 netmask 0xffffffff=20 inet6 fe80::21a:64ff:fe21:9489%gre1 prefixlen 64 scopeid 0x15=20 nd6 options=3D21 I have on-interface route for this interface: # netstat -rn | grep 172.16.0.0 172.16.0.0 link#21 UH gre1 /sbin/route reports the result incorrectly: # route -n get 172.16.0.0=20=20=20=20=20=20=20=20=20 route: writing to routing socket: No such process # route -n get 172.16.0.0/32 route: writing to routing socket: No such process # route -n get -host 172.16.0.0/32 route: writing to routing socket: No such process # route -n get -net 172.16.0.0/32 route: writing to routing socket: No such process # route -n get -net 172.16.0.0=20=20=20 route: writing to routing socket: No such process And only one method works: [root@crystal-alpha:/etc]# route -n get -host 172.16.0.0 route to: 172.16.0.0 destination: 172.16.0.0 fib: 0 interface: gre1 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1431 1 0 This behaviour differs significantly from other cases with point-to-point interfaces, with /32 network mask: # ifconfig gre0 gre0: flags=3Da051 metric 0 mtu 1431 options=3D80000 tunnel inet 172.16.4.27 --> 172.16.4.30 inet6 fe80::21a:64ff:fe21:9489%gre0 prefixlen 64 scopeid 0x14=20 inet 172.16.1.81 --> 172.16.1.80 netmask 0xffffffff=20 nd6 options=3D21 # route -n get 172.16.1.80 route to: 172.16.1.80 destination: 172.16.1.80 fib: 0 interface: gre0 flags: recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1431 1 0=20 This issue is probably triggered by the zeroes in te two last octets of the= IP address. I highly doubt someone still uses -net and -host switches, because= the approach "use network part without mask for 'route get'" works like 95% of = the time. I can still be wrong, but I really think this utility should be more straightforward, and there should not be any exceptions to a general rule. Furthermore, the message "route: writing to routing socket: No such process= " is kinda "blast from the past", since nobody can recall why is it still here a= nd what process is it talking about. It is cryptic, misleading and weird, I re= ally think it should be changed to something more appropriate. To my knowledge, route is not a process, it's rather an entity in the FIB. Although someone = may find the history behind this message intriguing and interesting, I personal= ly think it's some geological artifact that keeps people stubmling on. --=20 You are receiving this mail because: You are the assignee for the bug.=