Skip to contentSkip to conversation

netfilter: xt_osf: fix inversion

PATCH New [email protected] 1 participant 1 message Mar 24, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 netfilter: xt_osf: fix inversion

From: Pablo Neira Ayuso <[email protected]>

-m osf --genre Windows
-m osf ! --genre Windows

are both matching.

---
 net/netfilter/xt_osf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/xt_osf.c +2 -1
index a5e673d..110c848 100644
@@ -201,6 +201,7 @@ xt_osf_match_packet(const struct sk_buff *skb, struct xt_action_param *p)
 	unsigned char opts[MAX_IPOPTLEN];
 	const struct xt_osf_finger *kf;
 	const struct xt_osf_user_finger *f;
+	bool invert = info->flags & XT_OSF_INVERT;
 
 	if (!info)
 		return false;
@@ -349,7 +350,7 @@ xt_osf_match_packet(const struct sk_buff *skb, struct xt_action_param *p)
 	if (fcount)
 		fmatch = FMATCH_OK;
 
-	return fmatch == FMATCH_OK;
+	return (fmatch == FMATCH_OK) ^ invert;
 }
 
 static struct xt_match xt_osf_match = {
Signature · 1 line
1.7.10.4