Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230AbdHOCk4 (ORCPT ); Mon, 14 Aug 2017 22:40:56 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:48286 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753155AbdHOCkz (ORCPT ); Mon, 14 Aug 2017 22:40:55 -0400 Date: Mon, 14 Aug 2017 19:40:51 -0700 (PDT) Message-Id: <20170814.194051.1408830683580606508.davem@davemloft.net> To: marcelo.leitner@gmail.com Cc: hideaki.yoshifuji@miraclelinux.com, glider@google.com, dvyukov@google.com, kcc@google.com, edumazet@google.com, lucien.xin@gmail.com, vyasevich@gmail.com, linux-kernel@vger.kernel.org, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, yoshfuji@linux-ipv6.org Subject: Re: [PATCH v2] sctp: fully initialize the IPv6 address in sctp_v6_to_addr() From: David Miller In-Reply-To: <20170815015814.GB18688@localhost.localdomain> References: <20170814184304.82747-1-glider@google.com> <20170815015814.GB18688@localhost.localdomain> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 14 Aug 2017 19:40:54 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 837 Lines: 25 From: Marcelo Ricardo Leitner 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.