aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-28 13:51:28 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-28 13:51:28 +0200
commitd414c06fd9cf1eee53d17fba5bad94b4dc3fbf2a (patch)
treeec9ce74e2caf0a4f05447311d9bbc42ab023d006
parent732d9c19bf5c9e50b647ce87f01ac231b1f13c9c (diff)
nat: Fix a thinko in allowing '*' as a wildcard...
We need to match everything BUT the wildcard and then do the normal strcmp...
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index b345a77f5..b45f447ed 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -785,9 +785,9 @@ struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct
regex_t reg;
regmatch_t matches[2];
- if (entry->mcc[0] == '*' || strncmp(entry->mcc, imsi, 3) != 0)
+ if (entry->mcc[0] != '*' && strncmp(entry->mcc, imsi, 3) != 0)
continue;
- if (entry->mnc[0] == '*' || strncmp(entry->mnc, imsi + 3, 2) != 0)
+ if (entry->mnc[0] != '*' && strncmp(entry->mnc, imsi + 3, 2) != 0)
continue;
if (entry->text[0] == '+') {