Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2000 20:02:01 +0100
From:      Nik Clayton <nik@freebsd.org>
To:        Nik Clayton <nik@freebsd.org>
Cc:        hackers@freebsd.org
Subject:   Re: No route for 127/8 to lo0 (?)
Message-ID:  <20000421200201.A34984@catkin.nothing-going-on.org>
In-Reply-To: <20000331125739.A97865@catkin.nothing-going-on.org>; from nik@freebsd.org on Fri, Mar 31, 2000 at 12:57:40PM %2B0100
References:  <20000331125739.A97865@catkin.nothing-going-on.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 31, 2000 at 12:57:40PM +0100, Nik Clayton wrote:
> In the course of debugging why Samba was bringing my modem link up
> periodically, I discovered it was sending netbios packets to 
> 127.255.255.255.  Because the relevent entries from the routing table
> looked like
> 
> Destination        Gateway            Flags     Refs     Use     Netif Expire
> default            158.152.1.222      UGSc       22        0     tun0
> 127.0.0.1          127.0.0.1          UH          0      201      lo0
> [...]
> 
> 127.255.255.255 was going out of the default route, tun0, and bringing
> the line up.
[...]
> I thought that 127/8 was the "local net", and that packets sent to any of
> those addresses would go via the loopback interface.  That seems to be 
> how Linux and Windows 98 do things (the only systems I can check this on
> at the moment).  Assuming that's the case, why does FreeBSD only add a
> a host route to 127.0.0.1, and not a network route for 127/8?  Various
> other people have confirmed that they only have a 127.0.0.1 host route
> as well, so I don't believe this is a misconfiguration of my system.

No one's actually been able to answer this, save a few comments that the
loopback interface is special-cased to do this in the code, and that the
code in question is quite old.

In light of that, I'd like to commit:

Index: rc.network
===================================================================
RCS file: /home/ncvs/src/etc/rc.network,v
retrieving revision 1.74
diff -u -r1.74 rc.network
--- rc.network  2000/02/29 12:53:28     1.74
+++ rc.network  2000/04/21 18:48:15
@@ -254,6 +254,9 @@
                done
        fi
 
+       # 127/8 goes through lo0.
+       route add -net 127 -interface lo0
+
        echo -n 'Additional routing options:'
        case ${tcp_extensions} in
        [Yy][Ee][Ss] | '')

as a stop gap.

FWIW, the code in question is sys/netinet/in.c:in_ifinit(), around line
701.  Comments?

N
-- 
Internet connection, $19.95 a month.  Computer, $799.95.  Modem, $149.95.
Telephone line, $24.95 a month.  Software, free.  USENET transmission,
hundreds if not thousands of dollars.  Thinking before posting, priceless.
Somethings in life you can't buy.  For everything else, there's MasterCard.
  -- Graham Reed, in the Scary Devil Monastery


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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