From patchwork Wed Mar 21 09:44:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arushi Singhal X-Patchwork-Id: 888656 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qRBZhJ5Q"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 405lK92lsnz9s0n for ; Wed, 21 Mar 2018 20:45:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbeCUJpQ (ORCPT ); Wed, 21 Mar 2018 05:45:16 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:32881 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeCUJpP (ORCPT ); Wed, 21 Mar 2018 05:45:15 -0400 Received: by mail-pg0-f68.google.com with SMTP id g12so1744133pgs.0 for ; Wed, 21 Mar 2018 02:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=M3FI9IwfvQzFnMqktgxJDPCCw77LAqR39xsjgILllYM=; b=qRBZhJ5QNdojvN5Cf5xprlnQYc5WNVCu8v6/2Yc0c0jBF32Vc20PuPKBMNFMa/Stur NbFKGpxSdRtAxrNFSz+YprLcoLzgDwzXCrS/ESwGXdCe18v+G0UZRAboMbuJTDSdl2Ou eblp4QG9MCdJ2QkWQbaJFdvk5HeDJxmNVLrFYFUxcd/H1qbNlwYr7sKvB6Ta4FxtFQBS fnCy6AF5FNqGq1j93fiFwvvaiTPL1T1llqGk/w1IB1Ptfg+x/rRhGGY2mAjXgfzR9sP1 96A8wubSrDENo2mgZzOjpdn7w1f8qdkXVEv7tKsuswezhwelh4wxe1MdCeVOwgksA6vm ogPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=M3FI9IwfvQzFnMqktgxJDPCCw77LAqR39xsjgILllYM=; b=AqI4HC9P0cLHYTMKjpI7boHGJZLQlHjnueKKzytJCJJ49GeyVwk+emtelO7tkiIl0d W9oKT3up+fipI9v2HngODR3gs2EvVhllthw7lbpG2cj3Ku+eWgGW3jLwiQgESPv6GVmk iK3k3j7Sp2uMXH4wuJ1shygsIuTFbO6f+O4dwUb9yrGmVvU+MoWZ/XPXFnTNQ/cDuf0G 2ktHcv/6X076vYRtSoLB4Nb8I1mDPdPdeiNTuFuL1B1YyEeHY/PyZDrGl6HTRE+RRYs/ aUP5Pc3TynFpyy+Q54M70nvZuUHMBWn7WQavoHqs2bdZM8siiAw4hB/hUsrpr2FrKdxs Pjhw== X-Gm-Message-State: AElRT7H0cHcGZY9DKHfu3b3Y25cVtOzS77D5+IsqntY/JW/q2yauxAii mEQ7IDQplDs+PLqM85YDyz1o3g== X-Google-Smtp-Source: AG47ELtqN1nzv7yS9lnWYAtOOrFxBe90PVHJmY58Vf/4OzLnrgpa45ES7uEKjVKamVkh/zSaA/ttCg== X-Received: by 10.99.183.15 with SMTP id t15mr14789363pgf.416.1521625513661; Wed, 21 Mar 2018 02:45:13 -0700 (PDT) Received: from seema-Inspiron-15-3567 ([14.139.82.6]) by smtp.gmail.com with ESMTPSA id r9sm5747436pfg.128.2018.03.21.02.45.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 02:45:12 -0700 (PDT) Date: Wed, 21 Mar 2018 15:14:22 +0530 From: Arushi Singhal To: netfilter-devel@vger.kernel.org Cc: pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net, outreachy-kernel@googlegroups.com Subject: [PATCH] iptables: extension: Constify option struct Message-ID: <20180321094422.GA18335@seema-Inspiron-15-3567> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The struct of type option is only used to initialise a field and is not modified anywhere. Signed-off-by: Arushi Singhal --- extensions/libarpt_mangle.c | 2 +- iptables/iptables-xml.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/libarpt_mangle.c b/extensions/libarpt_mangle.c index ec9b543..0d1f140 100644 --- a/extensions/libarpt_mangle.c +++ b/extensions/libarpt_mangle.c @@ -32,7 +32,7 @@ static void arpmangle_print_help(void) #define MANGLE_DEVT '4' #define MANGLE_TARGET '5' -static struct option arpmangle_opts[] = { +static const struct option arpmangle_opts[] = { { .name = "mangle-ip-s", .has_arg = true, .val = MANGLE_IPS }, { .name = "mangle-ip-d", .has_arg = true, .val = MANGLE_IPT }, { .name = "mangle-mac-s", .has_arg = true, .val = MANGLE_DEVS }, diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c index 49674ec..69c19a6 100644 --- a/iptables/iptables-xml.c +++ b/iptables/iptables-xml.c @@ -38,7 +38,7 @@ static int verbose; /* Whether to combine actions of sequential rules with identical conditions */ static int combine; /* Keeping track of external matches and targets. */ -static struct option options[] = { +static const struct option options[] = { {"verbose", 0, NULL, 'v'}, {"combine", 0, NULL, 'c'}, {"help", 0, NULL, 'h'},