Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbdLLPx5 (ORCPT ); Tue, 12 Dec 2017 10:53:57 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:51446 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbdLLPxw (ORCPT ); Tue, 12 Dec 2017 10:53:52 -0500 Date: Tue, 12 Dec 2017 10:53:50 -0500 (EST) Message-Id: <20171212.105350.1862932376620064454.davem@davemloft.net> To: makita.toshiaki@lab.ntt.co.jp Cc: eric@regit.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net Subject: Re: [PATCH net-next] libbpf: add function to setup XDP From: David Miller In-Reply-To: References: <20171209144315.25890-1-eric@regit.org> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii 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]); Tue, 12 Dec 2017 07:53:52 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 778 Lines: 21 From: Toshiaki Makita Date: Mon, 11 Dec 2017 11:24:12 +0900 > On 2017/12/09 23:43, Eric Leblond wrote: >> Most of the code is taken from set_link_xdp_fd() in bpf_load.c and >> slightly modified to be library compliant. >> >> Signed-off-by: Eric Leblond > ... >> +int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags) > ... >> + for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); >> + nh = NLMSG_NEXT(nh, len)) { >> + if (nh->nlmsg_pid != getpid()) { > > Generally nlmsg_pid should not be compared with process id. > See man netlink and > https://github.com/iovisor/bcc/pull/1275/commits/69ce96a54c55960c8de3392061254c97b6306a6d Right. I wish we had never named this "pid", it gets misinterpreted way too easily.