From: Cong Wang <amwang@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org,
edumazet@google.com, ycheng@google.com, ncardwell@google.com
Subject: Re: [Patch net-next] tcp_metrics: rearrange fields to avoid holes
Date: Thu, 01 Aug 2013 16:13:42 +0800 [thread overview]
Message-ID: <1375344822.7780.17.camel@cr0> (raw)
In-Reply-To: <20130801.001551.84126063849926109.davem@davemloft.net>
On Thu, 2013-08-01 at 00:15 -0700, David Miller wrote:
> From: Cong Wang <amwang@redhat.com>
> Date: Thu, 01 Aug 2013 10:48:31 +0800
>
> > Please teach me how to do that?
>
> struct inet_addr {
> union {
> u32 v4;
> u32 v6[4];
> };
> };
>
> ie. exactly what that code is using already.
>
> And it's called called inetpeer_addr, we have it already, there is no
> need to make something new.
>
> Making this code use a structure with completely unnecessary and
> unused members is pointless and a step backwards.
Ah, I was thinking to keep it compatible with sockaddr*, actually this
is indeed unnecessary. I am going to define something like:
struct inet_addr_base {
union {
struct in_addr sin_addr;
struct in6_addr sin6_addr;
};
unsigned short int sin_family;
};
which could used by bridge multicast code too.
Thanks for the hint.
prev parent reply other threads:[~2013-08-01 8:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 2:48 [Patch net-next] tcp_metrics: rearrange fields to avoid holes Cong Wang
2013-07-31 3:08 ` Eric Dumazet
2013-07-31 3:13 ` Cong Wang
2013-07-31 3:24 ` Eric Dumazet
2013-07-31 3:35 ` Joe Perches
2013-07-31 3:40 ` Cong Wang
2013-07-31 3:37 ` Cong Wang
2013-07-31 3:57 ` Eric Dumazet
2013-07-31 6:26 ` David Miller
2013-08-01 2:48 ` Cong Wang
2013-08-01 7:15 ` David Miller
2013-08-01 8:13 ` Cong Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375344822.7780.17.camel@cr0 \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).