Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2001 18:08:45 -0800 (PST)
From:      Paul Herman <pherman@frenchfries.net>
To:        Ruslan Ermilov <ru@FreeBSD.ORG>
Cc:        <freebsd-net@FreeBSD.ORG>
Subject:   Re: arp_rtrequest: bad gateway value
Message-ID:  <20011123160634.I49441-100000@tick.sc.omation.com>
In-Reply-To: <20011122113610.C32952@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[...off list...]

On Thu, 22 Nov 2001, Ruslan Ermilov wrote:

> On Wed, Nov 21, 2001 at 05:32:27PM -0800, Paul Herman wrote:
> > Hi,
> >
> > I'd like to pick some brains before I file a PR.
> >
> There's already a PR open on this, kern/29170.
>
> [...]
>
> There's the problem with routed(8).  It issues a command
> similar to "route change ip ip" for each (but last) IP address
> of an interface if the route already exists and is different.
> This results in a changed route with AF_INET gateway, but
> route's IFA still points to Ethernet device and
> rt_ifa->ifa_rtrequest == arp_rtrequest.  This results in this
> message as AF_INET != AF_LINK.  The message is harmless.

Well this definately seems to me like bug in the kernel, because
route_output()/arp_rtrequest() both allow me to change the gateway
from a link addr to an inet addr, but still retain the RTF_LLINFO
flag.  This is an inconsistent state and should not be allowed.
Correct me if I'm wrong, but is there any (historical) case where
you would want this state?

Possible solutions:
  1) Ignore the change of the gateway if the AF_ type and
     RTF_ flags don't jive.
  2) Return an EINVAL if you try to assign an AF_INET gateway
     to an existing route that has RTF_LLINFO set.
  3) If an AF_INET gateway is given to an existing route with
     RTF_LLINFO set, try to convert the address to its link layer
     address, and then update the route.

IMO, although #1 obeys POLA but might be to permissive, and #3 is
probably to complicated for the kernel to do, so I think #2 might
be best.

Solution #2 would break routed, of course, so it would also have to
be changed, as well.  FWIW gated works fine and doesn't exhibit the
same behaviour that routed does.  Dunno about zebra, haven't
checked.

I'll be happy to see if I can whip up a patch, what does everyone
else think?

-Paul.



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




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