nat: Add '*' as wildcard for the IMSI matching.
In case any rule has a '*' we will always match this
rule.
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 59c92a3..e1f1ddc 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -783,9 +783,9 @@
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 */