[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231016123319.688bbd91@hermes.local>
Date: Mon, 16 Oct 2023 12:33:19 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
eric.dumazet@...il.com, syzbot <syzkaller@...glegroups.com>
Subject: Re: [PATCH net] tun: prevent negative ifindex
On Mon, 16 Oct 2023 18:08:51 +0000
Eric Dumazet <edumazet@...gle.com> wrote:
> + ret = -EINVAL;
> + if (ifindex < 0)
> + goto unlock;
Shouldn't this be <= 0 since 0 is not a valid ifindex.
Zero ifindex is used as a sentinel in some API's
For example: if_nametoindex() returns 0 if name is not found.
Powered by blists - more mailing lists