lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1280428952-14151-1-git-send-email-xiaosuo@gmail.com>
Date:	Fri, 30 Jul 2010 02:42:32 +0800
From:	Changli Gao <xiaosuo@...il.com>
To:	"David S. Miller" <davem@...emloft.net>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>,
	Jamal Hadi Salim <hadi@...erus.ca>, netdev@...r.kernel.org,
	Changli Gao <xiaosuo@...il.com>
Subject: [PATCH] act_nat: get the position info from skb->tc_verd

act_nat uses its flags field to determine where it acts. It isn't reliable,
and can't prevent users from doing wrong settings, and act_nat should get the
position info from skb->tc_verd as act_mirred does.

Signed-off-by: Changli Gao <xiaosuo@...il.com>
----
 include/net/tc_act/tc_nat.h |    2 +-
 net/sched/act_nat.c         |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/tc_act/tc_nat.h b/include/net/tc_act/tc_nat.h
index 4a691f3..343376a 100644
--- a/include/net/tc_act/tc_nat.h
+++ b/include/net/tc_act/tc_nat.h
@@ -10,7 +10,7 @@ struct tcf_nat {
 	__be32 old_addr;
 	__be32 new_addr;
 	__be32 mask;
-	u32 flags;
+	u32 flags;	/* unused */
 };
 
 static inline struct tcf_nat *to_tcf_nat(struct tcf_common *pc)
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
index 24e614c..144e118 100644
--- a/net/sched/act_nat.c
+++ b/net/sched/act_nat.c
@@ -121,7 +121,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
 	old_addr = p->old_addr;
 	new_addr = p->new_addr;
 	mask = p->mask;
-	egress = p->flags & TCA_NAT_FLAG_EGRESS;
+	egress = G_TC_AT(skb->tc_verd) & AT_EGRESS;
 	action = p->tcf_action;
 
 	p->tcf_bstats.bytes += qdisc_pkt_len(skb);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ