xt_pknock: avoid inversion of rule lookup that led to warnings

Commit v1.18-48-g58839b9 had this screwed up.
This commit is contained in:
Jan Engelhardt
2011-02-24 23:58:03 +01:00
parent 0ba44bd461
commit 32871bad39
2 changed files with 4 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ HEAD
==== ====
Fixes: Fixes:
- xt_pknock: avoid crash when hash TFM could not be allocated - xt_pknock: avoid crash when hash TFM could not be allocated
- xt_pknock: avoid inversion of rule lookup that led to warnings
v1.33 (2011-02-02) v1.33 (2011-02-02)

View File

@@ -398,19 +398,15 @@ peer_gc(unsigned long r)
/** /**
* Compares length and name equality for the rules. * Compares length and name equality for the rules.
*
* @info
* @rule
* @return: 0 equals, 1 otherwise
*/ */
static inline bool static inline bool
rulecmp(const struct xt_pknock_mtinfo *info, const struct xt_pknock_rule *rule) rulecmp(const struct xt_pknock_mtinfo *info, const struct xt_pknock_rule *rule)
{ {
if (info->rule_name_len != rule->rule_name_len) if (info->rule_name_len != rule->rule_name_len)
return true; return false;
if (strncmp(info->rule_name, rule->rule_name, info->rule_name_len) != 0) if (strncmp(info->rule_name, rule->rule_name, info->rule_name_len) != 0)
return true; return false;
return false; return true;
} }
/** /**