Subject: Re: Bug in routing socket handling
To: None <tech-net@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-net
Date: 10/23/2004 17:56:34
In article <864qkl62bc.fsf@athene.i.eunet.no>,
Tom Ivar Helbekkmo <tih@eunetnorge.no> wrote:
>I've submitted kern/27286, which includes a patch for a bug in the
>kernel's handling of routing socket requests.  The problem is the
>special case of an RTM_GET message that wants interface information
>included in the response, and therefore include the RTA_IFA or RTA_IFP
>(or both) flags in the bitmask that says what addresses are supplied
>in the message.  For the RTM_GET message, it doesn't make sense to
>supply addresses other than the one you're asking about, so those two
>other bits are, in that specific case, overloaded with this meaning.
>
>There is code in sys/net/rtsock.c to handle the case, but at some
>time, extra sanity checking of the received message was added, that
>failed to take this possibility into account.
>
>The patch, included below, fixes the problem.  I'd very much like to
>see it adopted, and included in 2.0, because it's needed for the
>Asterisk software PBX to work properly when it has multiple interfaces
>active: it needs to ask the kernel for the IP address of the interface
>that will be used to communicate with a given host.

I've looked at the FreeBSD and OpenBSD versions of rtsock.c and they
don't make any special provisions either. How does asterix work there?

christos