[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OF5EB046E4.6295C3A5-ON85257B40.00537077-85257B40.00542577@us.ibm.com>
Date: Mon, 1 Apr 2013 11:19:10 -0400
From: David Stevens <dlstevens@...ibm.com>
To: Cong Wang <amwang@...hat.com>
Cc: Cong Wang <amwang@...hat.com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
netdev-owner@...r.kernel.org,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [Patch net-next v1 3/4] vxlan: add ipv6 support
netdev-owner@...r.kernel.org wrote on 03/31/2013 01:43:44 AM:
> +struct vxlan_ip {
> + union {
> + __be32 ip4;
> +#if IS_ENABLED(CONFIG_IPV6)
> + struct in6_addr ip6;
> +#endif
> + };
> + __be16 proto;
> +};
> +
This looks suspiciously like a sockaddr. sockaddr_storage is
much bigger than you need, but you could just make it a sockaddr_in6
and cast it to sockaddr_in when needed, make it sockaddr_in6 and use
V4_MAPPED addresses for v4, or make it a union of sockaddr_in and
sockaddr_in6, or have a buffer the size of sockaddr_in6 and use it
as a sockaddr to determine the family, then go from there.
I think anything along those lines is better than a new variant
with the same functionality of sockaddr that isn't an overlay of a
sockaddr.
+-DLS
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists