From d414c06fd9cf1eee53d17fba5bad94b4dc3fbf2a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 28 Oct 2010 13:51:28 +0200 Subject: nat: Fix a thinko in allowing '*' as a wildcard... We need to match everything BUT the wildcard and then do the normal strcmp... --- openbsc/src/nat/bsc_nat_utils.c | 4 ++-- 1 file 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] == '+') { -- cgit v1.2.3