diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-27 10:11:48 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-27 10:40:44 +0200 |
commit | 25adfceb3a40661d8a0842ade18439bf622c3987 (patch) | |
tree | 665d8fc4a304d9842a802e0f02160e4f04de7d11 | |
parent | 73bbf8924588f5dc9088ac34ac3da2747b18f9dc (diff) |
nat: Add '*' as wildcard for the IMSI matching.
In case any rule has a '*' we will always match this
rule.
-rw-r--r-- | openbsc/src/nat/bsc_nat_utils.c | 4 |
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 59c92a38e..e1f1ddcfe 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -783,9 +783,9 @@ struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct regex_t reg; regmatch_t matches[2]; - if (strncmp(entry->mcc, imsi, 3) != 0) + if (entry->mcc[0] == '*' || strncmp(entry->mcc, imsi, 3) != 0) continue; - if (strncmp(entry->mnc, imsi + 3, 2) != 0) + if (entry->mnc[0] == '*' || strncmp(entry->mnc, imsi + 3, 2) != 0) continue; /* We have an entry for the IMSI. Need to match now */ |