Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Nov 2001 11:36:10 +0200
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Paul Herman <pherman@frenchfries.net>
Cc:        freebsd-net@FreeBSD.ORG, freebsd-alpha@FreeBSD.ORG
Subject:   Re: arp_rtrequest: bad gateway value
Message-ID:  <20011122113610.C32952@sunbay.com>
In-Reply-To: <20011121171802.P23581-100000@tick.sc.omation.com>
References:  <20011121171802.P23581-100000@tick.sc.omation.com>

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

--0F1p//8PRICkK4MW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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.

> I've got 4.4-RELEASE running on FreeBSD-alpha with more than one
> alias on my network interface.  I decided to try out routed, and
> started noticing gobs and gobs of messages:
> 
>   Nov 15 11:38:10 tick /kernel: arp_rtrequest: bad gateway value
>   Nov 15 11:43:10 tick /kernel: arp_rtrequest: bad gateway value
>   Nov 15 11:47:59 tick /kernel: arp_rtrequest: bad gateway value
>   Nov 15 11:58:02 tick last message repeated 2 times
>   Nov 15 12:08:10 tick last message repeated 2 times
>   Nov 15 12:18:10 tick last message repeated 2 times
> 
> It turns out, this is caused by a bad arp entry:
> 
>   17:21:33{{ttyq8}pherman@tick}~//> arp -a
>   ns1.sc.omation.com (192.168.128.1) at 0:0:0:0:0:0 permanent [ethernet] rt=200
>   tick.sc.omation.com (192.168.128.2) at 0:60:97:6e:6e:92 permanent [ethernet]
>   [...etc...]
> 
> Trying to delete the entry gives me "cannot locate 192.168.128.1",
> probably because the kernel thinks it doesn't exist becase the
> MAC addr == NULL... ...perhaps (?)  Whatever, it shouldn't be there
> in the first place.
> 
> So, I've narrowed this down to when routed it writes RTM_CHANGE
> of type RTF_HOST in sbin/routed/table.c:725
> 
>         if (mask == HOST_MASK) {
>                 w.w_rtm.rtm_flags |= RTF_HOST;
>                 w.w_rtm.rtm_msglen -= sizeof(w.w_mask);
>         } else {
>                 w.w_rtm.rtm_addrs |= RTA_NETMASK;
>                 w.w_mask.sin_addr.s_addr = htonl(mask);
> 
> Something is going haywire (64bit issues?) because when I change
> this to
> 
>         if (mask == HOST_MASK && 0) {
> 
> it works fine, but I'm sure I'm breaking something.  :-)  There
> *is* a sizeof(long) just after it on line 734 which should be a
> sizeof(u_int32_t), but that doesn't change anything in this case.
> This obviously works fine on 32-bit architectures, so I'm thinking
> it's some kind of alignment or sizeof problem, but I don't see it.
> 
> Can anyone comment on this?
> 
Please find attached a copy of my recent posting on this topic.
Hopefully, it exaplains the problem you observe in details.


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--0F1p//8PRICkK4MW
Content-Type: message/rfc822
Content-Disposition: inline

Date: Thu, 18 Oct 2001 17:39:35 +0300
From: Ruslan Ermilov <ru@FreeBSD.org>
To: Darren Henderson <darren@bmv.state.me.us>
Cc: stable@FreeBSD.ORG, net@FreeBSD.org
Subject: Re: /kernel: arp_rtrequest: bad gateway value
Message-ID: <20011018173935.A43019@sunbay.com>
References: <Pine.A41.4.21.0109251620020.25940-100000@katahdin.bmv.state.me.us> <Pine.A41.4.21.0109261254580.32808-100000@katahdin.bmv.state.me.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <Pine.A41.4.21.0109261254580.32808-100000@katahdin.bmv.state.me.us>; from darren@bmv.state.me.us on Wed, Sep 26, 2001 at 01:08:40PM -0400

On Wed, Sep 26, 2001 at 01:08:40PM -0400, Darren Henderson wrote:
> 
> Posted something similar the other day, but thought I would ask in a more
> general way....
> 
> What causes this error? Looking at the archives and source it appears to be
> related to aliases and if_inet.c
> 
> What has changed between 4.3 and 4.4 that would account for this error
> appearing under 4.4 but not appear under 4.3 on a system where the network
> configuration has not changed?
> 
> Everything appears to be working fine after the upgrade other then the
> appearance of this message numerous times during the day with no apparent
> pattern.
> 
> Any thoughts appreciated.
> 
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.  This is also reproduceable on a 4.1-RELEASE machine.

How to repeat without routed(8):

1.  Add IP address to your Ethernet interface:
	ifconfig rl0 192.168.1.1 alias

2.  Create route for this address:
	ping -c1 192.168.1.1

3.  Verify that the route was created with gateway of type AF_LINK:
	route -vn get 192.168.1.1

4.  Change the route like routed(8) does:
	route change 192.168.1.1 192.168.1.1

5.  Watch the dmesg(8) output then repeat "route get" command to
    see route's gateway changed to AF_INET:
	route -vn get 192.168.1.1


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--0F1p//8PRICkK4MW--

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?20011122113610.C32952>