nat: Patch the destination SMS address of a message
Use the same filtering infrasturcture to patch the SMSC
address in a CP-DATA/RP-DATA message. Add a very simple
testcase for this code.
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
index 38b5a09..f05ccaa 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
@@ -466,11 +466,11 @@
bsc_replace_string(_nat, &_nat->num_rewr_name, argv[0]);
if (_nat->num_rewr_name) {
rewr = osmo_config_list_parse(_nat, _nat->num_rewr_name);
- bsc_nat_num_rewr_entry_adapt(_nat, rewr);
+ bsc_nat_num_rewr_entry_adapt(_nat, &_nat->num_rewr, rewr);
talloc_free(rewr);
return CMD_SUCCESS;
} else {
- bsc_nat_num_rewr_entry_adapt(_nat, NULL);
+ bsc_nat_num_rewr_entry_adapt(_nat, &_nat->num_rewr, NULL);
return CMD_SUCCESS;
}
}