gprs_ns2_vty: udp: fixup dialect changes

Only accept receiving ipaccess style messages when use-reset-block
is selected.
If use-reset-block is disabled allow static NSVCs.

Change-Id: Ia787528b1a6fac6bf1570c21643ef6cd8c209108
This commit is contained in:
Alexander Couzens 2020-12-16 20:33:34 +01:00
parent 33c3c0655b
commit 8806796976
1 changed files with 6 additions and 2 deletions

View File

@ -901,7 +901,8 @@ int gprs_ns2_vty_create() {
/* TODO: could not bind on the specific address */ /* TODO: could not bind on the specific address */
return -1; return -1;
} }
bind->accept_ipaccess = true;
bind->accept_ipaccess = priv.vc_mode == NS2_VC_MODE_BLOCKRESET;
} }
/* create vcs */ /* create vcs */
@ -909,7 +910,10 @@ int gprs_ns2_vty_create() {
/* validate settings */ /* validate settings */
switch (vtyvc->ll) { switch (vtyvc->ll) {
case GPRS_NS2_LL_UDP: case GPRS_NS2_LL_UDP:
dialect = NS2_DIALECT_IPACCESS; if (priv.vc_mode == NS2_VC_MODE_BLOCKRESET)
dialect = NS2_DIALECT_IPACCESS;
else
dialect = NS2_DIALECT_STATIC_ALIVE;
if (strlen(vtyvc->remote.ip) == 0) { if (strlen(vtyvc->remote.ip) == 0) {
/* Invalid IP for VC */ /* Invalid IP for VC */
continue; continue;