Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jul 2000 15:48:54 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        itojun@iijlab.net
Cc:        net@FreeBSD.ORG
Subject:   change to struct route
Message-ID:  <200007121948.PAA74525@khavrinen.lcs.mit.edu>
In-Reply-To: <25456.963427321@coconut.itojun.org>
References:  <25456.963427321@coconut.itojun.org>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 13 Jul 2000 03:42:01 +0900, itojun@iijlab.net said:

> 	i'll want to do it for freebsd too (maybe post-4.1 item).
> 	are you guys happy with this?  the reason why we do not change
> 	the type for ro_dst (into sockaddr_storage) is that, if we do so,
> 	it will add too many typecasts in existing code.


> struct route {
> 	struct  rtentry *ro_rt;
> 	struct  sockaddr ro_dst;
> 	char padding[sizeof(struct sockaddr_storage) - sizeof(struct sockaddr)];
> };

I'd rather see:

struct route {
	struct	rtentry *ro_rt;
	union	{
		struct	sockaddr dstu_dst;
		struct	sockaddr_storage dstu_dstss;
	}	ro_dstu;
};

#define	ro_dst		ro_dstu.dstu_dst
#define	ro_dstss	ro_dstu.dstu_dstss

...which would be the Traditional BSD Way to do it.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick


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?200007121948.PAA74525>