[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170814.194051.1408830683580606508.davem@davemloft.net>
Date: Mon, 14 Aug 2017 19:40:51 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: marcelo.leitner@...il.com
Cc: hideaki.yoshifuji@...aclelinux.com, glider@...gle.com,
dvyukov@...gle.com, kcc@...gle.com, edumazet@...gle.com,
lucien.xin@...il.com, vyasevich@...il.com,
linux-kernel@...r.kernel.org, linux-sctp@...r.kernel.org,
netdev@...r.kernel.org, yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH v2] sctp: fully initialize the IPv6 address in
sctp_v6_to_addr()
From: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Date: Mon, 14 Aug 2017 22:58:14 -0300
> On Tue, Aug 15, 2017 at 10:43:59AM +0900, 吉藤英明 wrote:
>> > diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
>> > index 2a186b201ad2..a15d691829c6 100644
>> > --- a/net/sctp/ipv6.c
>> > +++ b/net/sctp/ipv6.c
>> > @@ -513,6 +513,8 @@ static void sctp_v6_to_addr(union sctp_addr *addr, struct in6_addr *saddr,
>> > addr->sa.sa_family = AF_INET6;
>> > addr->v6.sin6_port = port;
>> > addr->v6.sin6_addr = *saddr;
>> > + addr->v6.sin6_flowinfo = 0;
>> > + addr->v6.sin6_scope_id = 0;
>>
>> Please set flowinfo between port and addr.
>
> Why?
Store buffer compression.
You want to always initialize structure member in the order
they are in memory.
No, the compiler won't do this automatically.
Powered by blists - more mailing lists