Date: Sun, 1 Jul 2001 17:19:28 +0800 From: Igor Podlesny <poige@morning.ru> To: Wes Peters <wes@softweyr.com> Cc: freebsd-hackers@FreeBSD.ORG, freebsd-isp@FreeBSD.ORG Subject: Re[2]: Flight of the rat, living wreck..... Message-ID: <34931950.20010701171928@morning.ru> In-Reply-To: <3B3E0D93.79738728@softweyr.com> References: <754836544.20010630185133@morning.ru> <3B3E0D93.79738728@softweyr.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Igor Podlesny wrote:
>> > /*
>> > * Macro for finding the interface (ifnet structure) corresponding to one
>> > * of our IP addresses.
>> > */
>> > #define INADDR_TO_IFP(addr, ifp) \
>> > /* struct in_addr addr; */ \
>> > /* struct ifnet *ifp; */ \
>> > { \
>> > register struct in_ifaddr *ia; \
>> > \
>> > for (ia = in_ifaddrhead.tqh_first; \
>>
>> // so here we start looking through the queue
>>
>> > ia != NULL
>>
>> // sanity (I'd have written just (ia))
>>
>> > && ((ia->ia_ifp->if_flags & IFF_POINTOPOINT)? \
>>
>> // hm. special case if the interface is PTP
>>
>> > IA_DSTSIN(ia):IA_SIN(ia))->sin_addr.s_addr != (addr).s_addr; \
>>
>> // so it is like: if it is PTP, then we using DST address in comparison
>> // with addr.s_addr
>>
>> // it is the time I started to ask myself why it is so? why we're (ok,
>> // they're) checking for remote ip-address if the head comment
>> // says:
>> // * Macro for finding the interface (ifnet structure) corresponding to one
>> // * of our IP addresses.
>> // ^^^
>> // ^^^
> With point-to-point connections, the address at the opposite end of the
> connection is always used in the route table. When the interface is
> created as a point-to-point interface, a route is automatically entered
> from the local address to the opposite address.
nothing to say agains this... but which relation to the ipfw problem
you've found here?
> The "corresponding"
> in the comment at the beginning of the macro is interpreted rather loosely.
What do you mean by that? :)
p.s. The idea of my letter wasn't in incorrectly written on
interpreted code comment header, but in IPFW's 'me' broken
implementation.
--
Igor mailto:poige@morning.ru
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34931950.20010701171928>
