Subject: Re: ifa_rtrequest with unsafe typecast
To: None <tech-net@netbsd.org>
From: None <itojun@iijlab.net>
List: tech-net
Date: 01/16/2001 11:25:34
>	at the very end of sys/net/route.c:rtrequest(), we have lines like this:
>>#define SA(p) ((struct sockaddr *)(p))
>(snip)
>>	if (ifa->ifa_rtrequest)
>>		ifa->ifa_rtrequest(req, rt, SA(ret_nrt ? *ret_nrt : 0));
>	ret_nrt is typed as struct rtentry **, so we are casting rtentry *
>	into sockaddr *.  it does not make sense at all.  if the very first
>	element of struct rtentry is sockaddr, it does.  if any of you have
>	older source code tree, please check...

	I checked older source codes.  The above fragment is present,
	and is mistaken from 4.3-reno.  I was assuming that it was due to
	some merge/migration errors in the past, but it seems that it has
	been the same since 4.3-reno.

	does anyone know what is expected in sys/netiso/if_eon.c:eonrtrequest(),
	3rd argument?

itojun