From owner-freebsd-net Wed Jul 12 12:49: 6 2000 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id B308137B701 for ; Wed, 12 Jul 2000 12:49:03 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id PAA74525; Wed, 12 Jul 2000 15:48:54 -0400 (EDT) (envelope-from wollman) Date: Wed, 12 Jul 2000 15:48:54 -0400 (EDT) From: Garrett Wollman Message-Id: <200007121948.PAA74525@khavrinen.lcs.mit.edu> To: itojun@iijlab.net Cc: net@FreeBSD.ORG Subject: change to struct route In-Reply-To: <25456.963427321@coconut.itojun.org> References: <25456.963427321@coconut.itojun.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org < 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