From patchwork Wed Nov 6 11:51:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Bursztyka X-Patchwork-Id: 288851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 087C82C0087 for ; Wed, 6 Nov 2013 22:51:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932539Ab3KFLvl (ORCPT ); Wed, 6 Nov 2013 06:51:41 -0500 Received: from mga01.intel.com ([192.55.52.88]:62594 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932535Ab3KFLvj (ORCPT ); Wed, 6 Nov 2013 06:51:39 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 06 Nov 2013 03:51:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,646,1378882800"; d="scan'208";a="428723162" Received: from rd-180.fi.intel.com ([10.237.68.35]) by fmsmga002.fm.intel.com with ESMTP; 06 Nov 2013 03:51:11 -0800 From: Tomasz Bursztyka To: netfilter-devel@vger.kernel.org Cc: Tomasz Bursztyka Subject: [iptables-nftables PATCH] nft: arp: inhibate -l option so only a fixed size arhln is in use Date: Wed, 6 Nov 2013 13:51:09 +0200 Message-Id: <1383738669-25602-1-git-send-email-tomasz.bursztyka@linux.intel.com> X-Mailer: git-send-email 1.8.4.2 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org This is a temporary fallback mechanism until variable interface hardware address length can be handled through nftables. Signed-off-by: Tomasz Bursztyka --- iptables/xtables-arp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c index 18f285c..97dbca9 100644 --- a/iptables/xtables-arp.c +++ b/iptables/xtables-arp.c @@ -272,7 +272,8 @@ static int getmac_and_mask(char *from, char *to, char *mask) return 0; } -static int getlength_and_mask(char *from, uint8_t *to, uint8_t *mask) +/* Necessary when -l will be supported */ +/*static int getlength_and_mask(char *from, uint8_t *to, uint8_t *mask) { char *p, *buffer; int i; @@ -290,7 +291,7 @@ static int getlength_and_mask(char *from, uint8_t *to, uint8_t *mask) return -1; *to = (uint8_t)i; return 0; -} +}*/ static int get16_and_mask(char *from, uint16_t *to, uint16_t *mask, int base) { @@ -974,6 +975,9 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table) demand-load a protocol. */ opterr = 0; + /*-l is currently not supported: falling back to a fixed sized arhln*/ + fw.arp.arhln = 6; + while ((c = getopt_long(argc, argv, "-A:D:R:I:L::M:F::Z::N:X::E:P:Vh::o:p:s:d:j:l:i:vnt:m:c:", opts, NULL)) != -1) { @@ -1140,11 +1144,13 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table) break; case 'l':/* hardware length */ - check_inverse(optarg, &invert, &optind, argc); + xtables_error(PARAMETER_PROBLEM, "not supported"); + + /*check_inverse(optarg, &invert, &optind, argc); set_option(&options, OPT_H_LENGTH, &fw.arp.invflags, invert); getlength_and_mask(argv[optind - 1], &fw.arp.arhln, - &fw.arp.arhln_mask); + &fw.arp.arhln_mask);*/ break; case 8:/* protocol length */