Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 1996 00:16:00 -0700 (PDT)
From:      bmah@CS.Berkeley.EDU
To:        freebsd-gnats-submit@freebsd.org
Subject:   bin/1900: route(8) add -host does a meaningless nameserver lookup
Message-ID:  <199610270716.AAA12009@freefall.freebsd.org>
Resent-Message-ID: <199610270720.AAA12222@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1900
>Category:       bin
>Synopsis:       route(8) add -host does a meaningless nameserver lookup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 27 00:20:00 PDT 1996
>Last-Modified:
>Originator:     Bruce A. Mah
>Organization:
University of California at Berkeley, Computer Science Division
>Release:        2.1.0-RELEASE
>Environment:
FreeBSD wintermute.hip.berkeley.edu 2.1.0-RELEASE FreeBSD 2.1.0-RELEASE #0: Fri Feb  9 17:16:24 PST 1996     bmah@wintermute.hip.berkeley.edu:/usr/src/sys/compile/BMAH1  i386

>Description:
route(8) performs getnetbyname(3) lookups on hostname arguments even
if -host flag is given.  This can result in non-intuitive behavior
with respect to /etc/host.conf.  Setting host.conf to check hosts
then bind won't necessarily prevent a nameserver lookup during the
command "route add -host hostname gateway", even if both hostname
and gateway are defined in /etc/hosts.  Note that it's extremely
unlikely that getnetbyname(3) will return a meaningful answer
in this situation, anyways.

This condition arose when trying to set up a caching-only nameserver
on a host that was (at boot time) not connected to the Internet.
The route(8) commands in /etc/netstart were hanging waiting for the
local named(8) to respond, even though all of the hostname arguments
to route(8) were listed in /etc/hosts and route(8) was given a -host
flag.

I think that 2.1.5-RELEASE and 2.2-CURRENT also have this problem.

>How-To-Repeat:
See above.

>Fix:
*** route.c.orig        Wed Sep 14 10:35:37 1994
--- route.c     Fri Oct 25 23:27:30 1996
***************
*** 860,866 ****
                }
        }
        if ((val = inet_network(s)) != -1 ||
!           ((np = getnetbyname(s)) != NULL && (val = np->n_net) != 0)) {
  netdone:
                if (which == RTA_DST)
                        inet_makenetandmask(val, &su->sin);
--- 860,866 ----
                }
        }
        if ((val = inet_network(s)) != -1 ||
!           (forcehost == 0 && (np = getnetbyname(s)) != NULL && (val = np->n_net) != 0)) {
  netdone:
                if (which == RTA_DST)
                        inet_makenetandmask(val, &su->sin);

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610270716.AAA12009>