From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: netns_id in bpf_sk_lookup_{tcp,udp} Date: Tue, 20 Nov 2018 17:03:09 +0100 Message-ID: <689fbbe5-a5f9-d111-5291-229fc43d6f77@6wind.com> References: <15bf5496-523f-564f-443e-f3262bb9e668@gmail.com> <90ae2d6b-049a-90a2-05e5-66700e885b39@gmail.com> <55816e4b-1a00-a1f3-6514-f755b992a049@6wind.com> <077323f3-3026-06b5-fb4b-54383e5387f6@gmail.com> <1754196d-67a8-6632-878f-72e0e6c2d917@6wind.com> <954e5e2c-d72d-5a87-e050-3e550273cce0@gmail.com> Reply-To: nicolas.dichtel@6wind.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev , daniel@iogearbox.net To: David Ahern , Joe Stringer Return-path: Received: from mail-wm1-f50.google.com ([209.85.128.50]:36480 "EHLO mail-wm1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbeKUCdD (ORCPT ); Tue, 20 Nov 2018 21:33:03 -0500 Received: by mail-wm1-f50.google.com with SMTP id s11so2829478wmh.1 for ; Tue, 20 Nov 2018 08:03:12 -0800 (PST) In-Reply-To: <954e5e2c-d72d-5a87-e050-3e550273cce0@gmail.com> Content-Language: fr Sender: netdev-owner@vger.kernel.org List-ID: Le 20/11/2018 à 16:46, David Ahern a écrit : > On 11/20/18 2:05 AM, Nicolas Dichtel wrote: >> Le 20/11/2018 à 00:46, David Ahern a écrit : [snip] >>> Seems like alloc_netid() should error out if reqid < -1 (-1 being the >>> NETNSA_NSID_NOT_ASSIGNED flag) as opposed to blindly ignoring it. >> alloc_netid() tries to allocate the specified nsid if this nsid is valid, ie >= >> 0, else it allocates a new nsid (actually the lower available). >> This is the expected behavior. >> >> For me, it's more an iproute2 problem, which parses an unsigned and silently >> cast it to a signed value. > > so your intention is that any < 0 value means auto generate not just -1. Yes. If a valid value is not provided, the kernel tries to allocate one. Nicolas