From patchwork Sun Nov 19 15:05:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taehee Yoo X-Patchwork-Id: 839333 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Vlq6p00O"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yfwD546zcz9rxl for ; Mon, 20 Nov 2017 02:06:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753264AbdKSPG2 (ORCPT ); Sun, 19 Nov 2017 10:06:28 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:42329 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753237AbdKSPG1 (ORCPT ); Sun, 19 Nov 2017 10:06:27 -0500 Received: by mail-pg0-f66.google.com with SMTP id j16so5394730pgn.9 for ; Sun, 19 Nov 2017 07:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eCEaVyqD6rFNYk/M6rfeRZa/8Bfvq0abRfaWrkQlZ/w=; b=Vlq6p00OOl13xFFAwhkuKoT0obPlCJ+jesPzFSppQMp8qtmff92Mb4/TCIwPr/F03b 70/17KIPrLGgt4hPWPsBXag1ySlJKxQ0/DgNYlBXbtkb6F4+STvf75ekkDgP023oOIrD gIumr+KmcEmiq/EzxVmXi19Tg3j2uCPX/K3OQhd2VHqOooHMk66ENB2TvpiyWDPFwnrT fUS6b4cpbZV1ZPmxkp+Hl38tXPf1anust5fzsxxl4QPTu5BGFKzKiNNzxRUGNRdgQ93t 2yixCWryLkgTMyReEpQmeGYHEP5GYsEhcRvaeosp5ghWlygb1qiu+0PCI91H4UYmSL4H /Zkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eCEaVyqD6rFNYk/M6rfeRZa/8Bfvq0abRfaWrkQlZ/w=; b=Gq2D4GZ7wZWQkr5JaeyOxs+3Rr4HR4pzmzaAh42wyKL+2kfVm4Exfsr+Jx8ECzqC68 pcnGHw4pvDvri45vXBp4G0SW0zVsYdD0p7z0bC4noTtQ4X2oLzSS3L92j+MSIrKW+D87 II8j+hRCumFb0gtLDd6BM0o0AH1Ws85LE7yxJYo4bSsfbrcUFmOOU9Z+R/k91G1aofYs i1v6sI5U1gOtFvYhbqJssgJyW+q16N2O4lYEbJlX9npzOgBTbfcHPwakYM18kxuwrmZ/ 6r2mSjjFVPADT1N8cYOeLu0hfX3zZy07ztXo3+hX/V2fy7utukP6Pri+NtBlhhpbNMqn nbcQ== X-Gm-Message-State: AJaThX5KpKvEkUMHyAIQTlH98hnEh0WCP4OnhCZeMcYBGo3Qr9MChZzI w4X4ZucShqrx3qewnh2mi8w= X-Google-Smtp-Source: AGs4zMY2B+CRBGkNYsEXuqqxEWqxfcdiHQnbKjv71wGSTVb1/LQrQ2dW33ezyaFzxHZq9UoLcjpSJg== X-Received: by 10.101.101.131 with SMTP id u3mr3546307pgv.76.1511103986955; Sun, 19 Nov 2017 07:06:26 -0800 (PST) Received: from ap-To-be-filled-by-O-E-M.8.8.8.8 ([125.130.197.10]) by smtp.gmail.com with ESMTPSA id h8sm12922797pgq.82.2017.11.19.07.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 07:06:26 -0800 (PST) From: Taehee Yoo To: pablo@netfilter.org, fw@strlen.de, netfilter-devel@vger.kernel.org Cc: ap420073@gmail.com Subject: [PATCH V3 3/5] netfilter: nf_nat_snmp_basic: replace ctinfo with dir. Date: Mon, 20 Nov 2017 00:05:57 +0900 Message-Id: <20171119150559.18125-4-ap420073@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171119150559.18125-1-ap420073@gmail.com> References: <20171119150559.18125-1-ap420073@gmail.com> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org The snmp_translate() receives ctinfo data to get dir value only. because of caller already has dir value, we just replace ctinfo with dir. Signed-off-by: Taehee Yoo --- V3 : - be separated by previous patch. V2 : - Add missing nf_nat_snmp_basic.asn1 file V1 : - Initial patch net/ipv4/netfilter/nf_nat_snmp_basic.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index e5ec946..c8ac57f 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c @@ -1082,15 +1082,12 @@ static int snmp_parse_mangle(unsigned char *msg, /* * SNMP translation routine. */ -static int snmp_translate(struct nf_conn *ct, - enum ip_conntrack_info ctinfo, - struct sk_buff *skb) +static int snmp_translate(struct nf_conn *ct, int dir, struct sk_buff *skb) { struct iphdr *iph = ip_hdr(skb); struct udphdr *udph = (struct udphdr *)((__be32 *)iph + iph->ihl); u_int16_t udplen = ntohs(udph->len); u_int16_t paylen = udplen - sizeof(struct udphdr); - int dir = CTINFO2DIR(ctinfo); struct oct1_map map; /* @@ -1155,7 +1152,7 @@ static int help(struct sk_buff *skb, unsigned int protoff, return NF_DROP; spin_lock_bh(&snmp_lock); - ret = snmp_translate(ct, ctinfo, skb); + ret = snmp_translate(ct, dir, skb); spin_unlock_bh(&snmp_lock); return ret; }