Subject: Re: struct route
To: None <itojun@iijlab.net>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-net
Date: 07/12/2000 11:38:51
On Thu, Jul 13, 2000 at 03:31:43AM +0900, itojun@iijlab.net wrote:
> i agree going to sockaddr_storage is the best solution. however,
> there are many places where type of "ro_dst" is assumed to be
> sockaddr, like:
> struct sockaddr *sa;
> sa = &ro.ro_dst;
> so i just worried about more gratuitous diffs due to the type change
> and additional typecasts.
ok, how about:
struct route {
struct rtentry *ro_rt;
union {
struct sockaddr roun_dst_sa;
struct sockaddr_storage roun_dst_ss;
} ro_un;
#define ro_dst ro_un.roun_dst_sa /* compatiblity */
#define ro_dst_sa ro_un.roun_dst_ss
};
--
-- Jason R. Thorpe <thorpej@zembu.com>