[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpX0ZzVH-OOo=bP7Mm9_0BzJ+aVwK30CiUok24hrTcYzAA@mail.gmail.com>
Date: Tue, 7 Apr 2015 14:11:24 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Tom Herbert <tom@...bertland.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Tom Herbert <therbert@...gle.com>
Subject: Re: [Patch net-next 3/5] fou: fix byte order of udp_config.local_udp_port
On Mon, Apr 6, 2015 at 11:09 PM, Tom Herbert <tom@...bertland.com> wrote:
> On Mon, Apr 6, 2015 at 4:41 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
>> diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
>> index ad0ee82..cf606fc 100644
>> --- a/net/ipv4/fou.c
>> +++ b/net/ipv4/fou.c
>> @@ -468,7 +468,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg,
>> sk = sock->sk;
>>
>> fou->flags = cfg->flags;
>> - fou->port = cfg->udp_config.local_udp_port;
>> + fou->port = ntohs(cfg->udp_config.local_udp_port);
>>
> Cong, I don't think this is right. Port should always be nbo, probably
> should be using __b16 instead of u16 for defines. Did you test these
> changes?
>
Yeah, fou->port is u16 which should be host order, however
we only save and compare it with be16, so the original code
is not mis-behaving (otherwise should go to -net), just reads odd.
I tested it together with the whole patchset. And I agree we can
change fou->port to be16 too.
I will wait for more feedback before sending v2.
Thanks!
--
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