From robert@fledge.watson.org  Thu Mar  7 12:32:43 2002
Return-Path: <robert@fledge.watson.org>
Received: from fledge.watson.org (fledge.watson.org [204.156.12.50])
	by hub.freebsd.org (Postfix) with ESMTP id 9B3E637B402
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  7 Mar 2002 12:32:41 -0800 (PST)
Received: (from robert@localhost)
	by fledge.watson.org (8.11.6/8.11.6) id g27KWXJ21156;
	Thu, 7 Mar 2002 15:32:33 -0500 (EST)
	(envelope-from robert)
Message-Id: <200203072032.g27KWXJ21156@fledge.watson.org>
Date: Thu, 7 Mar 2002 15:32:33 -0500 (EST)
From: Robert Watson <rwatson@freebsd.org>
Reply-To: Robert Watson <rwatson@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Layer 2 switching using default router of "self" broken
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35645
>Category:       kern
>Synopsis:       Layer 2 switching using default router of "self" broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bms
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 07 12:40:01 PST 2002
>Closed-Date:    Sat Sep 23 14:49:53 GMT 2006
>Last-Modified:  Sat Sep 23 14:49:53 GMT 2006
>Originator:     Robert Watson
>Release:        FreeBSD 5.0-CURRENT
>Organization:
NAI LAbs
>Environment:
System: FreeBSD fledge.watson.org 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #0: Fri Dec 21 21:55:59 EST 2001 robert@fledge.watson.org:/usr/obj/data/fbsd-stable/src/sys/FLEDGE i386

>Description:

Many network stacks use a default route of the local IP address to
represent a switch model in which all packets destined for the default
route are handled by attempting direct link-layer delivery to the
destination over the local interface associated with the IP address.
As a result, some network configurations provide the same IP address
for use both as the host address and the default router via DHCP,
which on FreeBSD results in an inability to send packets off the
local network segment.

Bill Fenner suggests that the FreeBSD stack wants:

   route add default -interface foo0

Instead of use of the IP address, and that the dhclient script should
do the mapping to the appropriate FreeBSD incantation.

>How-To-Repeat:
>Fix:

This is probably an example of a common IP stack quirk being assumed
and propagated to hosts where it's not true.  However, it means that
FreeBSD doesn't work "out of the box" in some switched network
environments.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 09:06:23 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 

I concur with what Bill Fenner says about what the stack wants. Can this 
behaviour be worked around with some dhclient config-fu? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35645 
State-Changed-From-To: open->feedback 
State-Changed-By: bms 
State-Changed-When: Tue 25 Nov 2003 09:07:05 PST 
State-Changed-Why:  
See comment above re: workaround with dhclient config-fu? 


http://www.freebsd.org/cgi/query-pr.cgi?pr=35645 

From: Brooks Davis <brooks@one-eyed-alien.net>
To: bug-followup@FreeBSD.org, rwatson@FreeBSD.org
Cc:  
Subject: kern/35645 : Layer 2 switching using default router of "self" broken
Date: Sat, 19 Aug 2006 09:24:30 -0500

 --BXVAT5kNtrzKuDFl
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 I ran into this PR by accident and since there's dhclient component I
 thought I'd follow up.  I'm unclear what a network admin would be trying
 to accomplish by setting the default route to the local IP address.  Is
 the goal simply to say that the network doesn't have a router on it or
 are they operating on the assumption that there's a router out there
 that will respond to ARPs for all possible IP addresses?  If fenner's
 suggestion actually works it would be trivial to implement in
 dhclient-script.  Otherwise we should probably ignore the route entirely
 and at least get local connection.
 
 -- Brooks
 
 --BXVAT5kNtrzKuDFl
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.5 (FreeBSD)
 
 iD8DBQFE5x8dXY6L6fI4GtQRAmgrAKCfzRq/D/ba2Kj3T7Cfe+T6QkT64ACgu2gi
 ACSHTM2wPrFAgVqiPASOd6M=
 =JT3h
 -----END PGP SIGNATURE-----
 
 --BXVAT5kNtrzKuDFl--

From: "Bruce M. Simpson" <bms@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/35645 : Layer 2 switching using default router of "self"
 broken
Date: Sat, 23 Sep 2006 14:11:02 +0100

 This is a multi-part message in MIME format.
 --------------020109010209090901040901
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Trying to get GNATS to pick up this feedback.
 
 --------------020109010209090901040901
 Content-Type: message/rfc822;
  name*0="Re: kern/35645 : Layer 2 switching using default router of \"sel";
  name*1="f\" broken"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename*0="Re: kern/35645 : Layer 2 switching using default router of \";
  filename*1=""self\" broken"
 
 Date: Sat, 19 Aug 2006 21:19:16 +0100
 From: Bruce M Simpson <bms@incunabulum.net>
 To: Brooks Davis <brooks@one-eyed-alien.net>
 Cc: bms@FreeBSD.org
 Subject: Re: kern/35645 : Layer 2 switching using default router of "self" broken
 Message-ID: <20060819201916.GN5291@incunabulum.net>
 References: <200608191430.k7JEUNOj034964@freefall.freebsd.org>
 Mime-Version: 1.0
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 In-Reply-To: <200608191430.k7JEUNOj034964@freefall.freebsd.org>
 Organization: Incunabulum
 User-Agent: Mutt/1.5.11
 
 To my mind, there is nothing functionally wrong with the stack dealing
 with the default route by way of ARP resolution.
 It may not be desirable -- this would be extremely bad behaviour for
 FreeBSD as a router -- but for hosts in the scenario Robert describes
 in his original PR, it is something we should be able to handle.
 
 The way to do this, of course, is to treat 0/0 as an interface route.
 
 Having said that, in lieu of long overdue rewrites of the network code,
 I am more in favour of implementing the DHCP based fix. That at least
 I believe would work, although I believe Robert's original posting is
 along the lines of 'why won't it work this way?'.
 
 Of course according to a strict interpretation of a next-hop of <one of
 my ip addresses>, it would indeed mean forwarding via loopback, i.e.
 a loop, i.e. forwarding to onesself. In other words, FreeBSD already
 does the right thing in the stack, and we should recognise when we're
 being handed a candidate default route of 'ourselves' via DHCP as it
 makes no sense in terms of the IPv4 forwarding table -- our own IP
 address as a next-hop will ultimately resolve to loopback, as a casual
 glance at 'netstat -rn' reveals.
 
 Otherwise, we risk introducing a further special case into the forwarding
 code itself.
 
 --------------020109010209090901040901--
State-Changed-From-To: feedback->closed 
State-Changed-By: bms 
State-Changed-When: Sat Sep 23 14:49:38 UTC 2006 
State-Changed-Why:  
dhclient-script knows what to do now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=35645 
>Unformatted:
