From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: netns_id in bpf_sk_lookup_{tcp,udp} Date: Mon, 19 Nov 2018 11:39:14 -0700 Message-ID: <90ae2d6b-049a-90a2-05e5-66700e885b39@gmail.com> References: <15bf5496-523f-564f-443e-f3262bb9e668@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev , daniel@iogearbox.net To: Joe Stringer Return-path: Received: from mail-pl1-f175.google.com ([209.85.214.175]:33319 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725722AbeKTFEE (ORCPT ); Tue, 20 Nov 2018 00:04:04 -0500 Received: by mail-pl1-f175.google.com with SMTP id z23so3749724plo.0 for ; Mon, 19 Nov 2018 10:39:17 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/19/18 11:36 AM, Joe Stringer wrote: > Hi David, thanks for pointing this out. > > This is more of an oversight through iterations, the runtime lookup > will fail to find a socket if the netns value is greater than the > range of a uint32 so I think it would actually make more sense to drop > the parameter size to u32 rather than u64 so that this would be > validated at load time rather than silently returning NULL because of > a bad parameter. ok. I was wondering if it was a u64 to handle nsid of 0 which as I understand it is a legal nsid. If you drop to u32, how do you know when nsid has been set? > > I'll send a patch to bpf tree. > ok.