From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 994B0C43387 for ; Fri, 18 Jan 2019 14:32:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 701382086D for ; Fri, 18 Jan 2019 14:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727502AbfAROcN (ORCPT ); Fri, 18 Jan 2019 09:32:13 -0500 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:34674 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbfAROcM (ORCPT ); Fri, 18 Jan 2019 09:32:12 -0500 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1gkVBo-0000kC-8g; Fri, 18 Jan 2019 15:32:08 +0100 Date: Fri, 18 Jan 2019 15:32:08 +0100 From: Florian Westphal To: Pablo Neira Ayuso Cc: wenxu@ucloud.cn, fw@strlen.de, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, David Ahern Subject: Re: [PATCH v3] netfilter: nft_meta: Add NFT_META_I/OIFKIND meta type Message-ID: <20190118143208.42q5ifmidcvtphtt@breakpoint.cc> References: <1547596431-31824-1-git-send-email-wenxu@ucloud.cn> <20190118142430.rsnru4hyrbsodobf@salvia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190118142430.rsnru4hyrbsodobf@salvia> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Pablo Neira Ayuso wrote: > > + case NFT_META_IIFKIND: > > + if (in == NULL || in->rtnl_link_ops == NULL) > > + goto err; > > + strncpy((char *)dest, in->rtnl_link_ops->kind, IFNAMSIZ); > > It seems kind can be arbitrarily large, no limitation in its length. Its limited to 60 or 56 bytes it seems: char kind[MODULE_NAME_LEN]; nla_strlcpy(kind, linfo[IFLA_INFO_KIND], sizeof(kind)); (linkinfo_to_kind_ops in rtnetlink.c). > Thinking... > > There is no other way to identify a vft device rather than this > string? The only l3mdev that exists if vrf, right? There is, I suggested this more generic approach, as it would allow to create rules that match on the kind of device used (vrf, ppp, etc.). If you think its too generic, ok.