From nobody@FreeBSD.org  Sat Jun 28 14:52:05 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22C58106567C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Jun 2008 14:52:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E39A8FC17
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Jun 2008 14:52:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5SEq4C1093632
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 28 Jun 2008 14:52:04 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m5SEq44p093631;
	Sat, 28 Jun 2008 14:52:04 GMT
	(envelope-from nobody)
Message-Id: <200806281452.m5SEq44p093631@www.freebsd.org>
Date: Sat, 28 Jun 2008 14:52:04 GMT
From: Aragon Gouveia <aragon@phat.za.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: host routes added by ppp with gateway flag
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         125079
>Category:       kern
>Synopsis:       [ppp] host routes added by ppp with gateway flag (regression)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bz
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 28 15:00:01 UTC 2008
>Closed-Date:    Sun Jan 04 15:46:42 UTC 2009
>Last-Modified:  Wed May 13 20:40:00 UTC 2009
>Originator:     Aragon Gouveia
>Release:        7.0-STABLE
>Organization:
>Environment:
FreeBSD nelson.infinite 7.0-STABLE FreeBSD 7.0-STABLE #0: Sat Jun 21 17:37:41 SAST 2008     root@nelson.infinite:/usr/obj/usr/src/sys/NELSON  i386
>Description:
I recently migrated a 6.2 system to 7.0-STABLE.  One of the system's
functions was a PPPoE gateway that performed Proxy ARP for its PPP clients.

In 6.2 days when a connection was made the route entry for the PPP client
showed:

192.168.9.245      192.168.9.X        UH          0        1   tun0
192.168.9.245      00:1b:78:37:d1:97  UHLS2       1        0   bge0

192.168.9.X being the PPPoE server's IP, and bge0 being its ethernet device.

On the 7.0 system the route entry looks like this:

192.168.9.248      192.168.9.X        UGH         0        0   bge0
192.168.9.248      00:1f:29:78:25:9d  UHLS2       1        0   bge0

And the PPPoE connection doesn't work.  I have to manually remove the route
entry and recreate it with the -interface argument to get things working.

I'm fairly convinced this is an unintended bug, but couldn't get a response
from anyone on freebsd-net to confirm.

>How-To-Repeat:
Use PPP and PPPoE settings similar to:

<--- ppp.conf --->
default:
 set log Phase Chat LCP IPCP CCP tun command
 ident user-ppp VERSION (built COMPILATIONDATE)

pppoein:
 allow mode direct
 enable lqr echo proxy
 enable chap
 set ifaddr 192.168.9.1 192.168.9.241-192.168.9.254
 accept dns
 set dns 192.168.9.1


<--- grep pppoed /etc/rc.conf --->
pppoed_enable="YES"
pppoed_provider="pppoein"
pppoed_interface="bge0"
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Jun 28 17:49:57 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125079 
State-Changed-From-To: open->closed 
State-Changed-By: vwe 
State-Changed-When: Sun Jan 4 15:45:32 UTC 2009 
State-Changed-Why:  
closing this PR in favour of bin/130159 (seems to be the same issue) 
which contains a patch 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125079 
Responsible-Changed-From-To: freebsd-net->bz 
Responsible-Changed-By: bz 
Responsible-Changed-When: Tue Apr 14 19:43:57 UTC 2009 
Responsible-Changed-Why:  
follow-ups to me. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125079: commit references a PR
Date: Mon, 20 Apr 2009 14:39:03 +0000 (UTC)

 Author: bz
 Date: Mon Apr 20 14:38:48 2009
 New Revision: 191316
 URL: http://svn.freebsd.org/changeset/base/191316
 
 Log:
   Conditionally add the interface name and address if available
   so that a ppp running in `receiver' (server) mode can properly
   update routes, for example to update the MTU.
   
   Submitted by:	loos.br gmail.com (Luiz Otavio O Souza)
   PR:		bin/130159
   PR:		kern/125079, kern/122068, bin/126892
   MFC after:	3 days
 
 Modified:
   head/usr.sbin/ppp/ipcp.c
   head/usr.sbin/ppp/ipv6cp.c
   head/usr.sbin/ppp/route.c
   head/usr.sbin/ppp/route.h
 
 Modified: head/usr.sbin/ppp/ipcp.c
 ==============================================================================
 --- head/usr.sbin/ppp/ipcp.c	Mon Apr 20 14:36:01 2009	(r191315)
 +++ head/usr.sbin/ppp/ipcp.c	Mon Apr 20 14:38:48 2009	(r191316)
 @@ -692,7 +692,7 @@ ipcp_SetIPaddress(struct ipcp *ipcp, str
    if (bundle->ncp.cfg.sendpipe > 0 || bundle->ncp.cfg.recvpipe > 0) {
      ncprange_getsa(&myrange, &ssgw, &ssmask);
      ncpaddr_getsa(&hisncpaddr, &ssdst);
 -    rt_Update(bundle, sadst, sagw, samask);
 +    rt_Update(bundle, sadst, sagw, samask, NULL, NULL);
    }
  
    if (Enabled(bundle, OPT_SROUTES))
 
 Modified: head/usr.sbin/ppp/ipv6cp.c
 ==============================================================================
 --- head/usr.sbin/ppp/ipv6cp.c	Mon Apr 20 14:36:01 2009	(r191315)
 +++ head/usr.sbin/ppp/ipv6cp.c	Mon Apr 20 14:38:48 2009	(r191316)
 @@ -245,7 +245,7 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6c
        ncpaddr_getsa(&ipv6cp->hisaddr, &ssdst);
      else
        sadst = NULL;
 -    rt_Update(bundle, sadst, sagw, samask);
 +    rt_Update(bundle, sadst, sagw, samask, NULL, NULL);
    }
  
    if (Enabled(bundle, OPT_SROUTES))
 
 Modified: head/usr.sbin/ppp/route.c
 ==============================================================================
 --- head/usr.sbin/ppp/route.c	Mon Apr 20 14:36:01 2009	(r191315)
 +++ head/usr.sbin/ppp/route.c	Mon Apr 20 14:38:48 2009	(r191316)
 @@ -532,7 +532,8 @@ route_UpdateMTU(struct bundle *bundle)
                     " mtu %lu\n", rtm->rtm_index, Index2Nam(rtm->rtm_index),
                     ncprange_ntoa(&dst), bundle->iface->mtu);
        }
 -      rt_Update(bundle, sa[RTAX_DST], sa[RTAX_GATEWAY], sa[RTAX_NETMASK]);
 +      rt_Update(bundle, sa[RTAX_DST], sa[RTAX_GATEWAY], sa[RTAX_NETMASK],
 +                sa[RTAX_IFP], sa[RTAX_IFA]);
      }
    }
  
 @@ -870,7 +871,8 @@ failed:
  
  void
  rt_Update(struct bundle *bundle, const struct sockaddr *dst,
 -          const struct sockaddr *gw, const struct sockaddr *mask)
 +          const struct sockaddr *gw, const struct sockaddr *mask,
 +          const struct sockaddr *ifp, const struct sockaddr *ifa)
  {
    struct ncprange ncpdst;
    struct rtmsg rtmes;
 @@ -920,6 +922,13 @@ rt_Update(struct bundle *bundle, const s
      p += memcpy_roundup(p, mask, mask->sa_len);
    }
  
 +  if (ifa && ifp && ifp->sa_family == AF_LINK) {
 +    rtmes.m_rtm.rtm_addrs |= RTA_IFP;
 +    p += memcpy_roundup(p, ifp, ifp->sa_len);
 +    rtmes.m_rtm.rtm_addrs |= RTA_IFA;
 +    p += memcpy_roundup(p, ifa, ifa->sa_len);
 +  }
 +
    rtmes.m_rtm.rtm_msglen = p - (char *)&rtmes;
  
    wb = ID0write(s, &rtmes, rtmes.m_rtm.rtm_msglen);
 
 Modified: head/usr.sbin/ppp/route.h
 ==============================================================================
 --- head/usr.sbin/ppp/route.h	Mon Apr 20 14:36:01 2009	(r191315)
 +++ head/usr.sbin/ppp/route.h	Mon Apr 20 14:38:48 2009	(r191316)
 @@ -70,4 +70,5 @@ extern void route_ParseHdr(struct rt_msg
  extern int rt_Set(struct bundle *, int, const struct ncprange *,
                    const struct ncpaddr *, int, int);
  extern void rt_Update(struct bundle *, const struct sockaddr *,
 +                      const struct sockaddr *, const struct sockaddr *,
                        const struct sockaddr *, const struct sockaddr *);
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: Boris Kochergin <spawk@acm.poly.edu>
To: bug-followup@FreeBSD.org
Cc:  
Subject: kern/125079: [ppp] host routes added by ppp with gateway flag (regression)
Date: Wed, 13 May 2009 16:38:15 -0400

 Can this be MFC'd? It appears to have fallen through the cracks.
>Unformatted:
