aboutsummaryrefslogtreecommitdiffstats
path: root/src/hnbgw_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-08-18 02:18:00 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-08-18 03:21:22 +0200
commitf495b2347bfc0c974e33988f8240be5cb7b2db3b (patch)
tree6ffbbf0f52ea6b418cc1e1fc49a99d46e6b16b9f /src/hnbgw_vty.c
parent926153b9af0659e8c214f40424e29cda0c821607 (diff)
hnbgw: make Iuh bind address configurable via VTY
Add config node hnbgw/iuh/bind, taking an IPv4 address. Use this address to bind the Iuh server. This is particularly useful for the ip.access nano3G, which is very sensitive with SCTP addresses that don't respond to SCTP heartbeats. If the hnbgw listens on 0.0.0.0, there will be SCTP heartbeats for all local interfaces on the machine that the hnbgw runs on; the nano3G will interpret the "missing", or rather, redundant heartbeat acks for the interfaces that aren't really related to the Iuh server and assume a broken Iuh link, leading to an Iuh shutdown and reconnection, looping every minute or so. By binding the hnbgw to only one local interface, the SCTP addresses can be reduced and "missing" heartbeat acks can be avoided. Change-Id: Ie2749c152b878e17aa65dfb806826357d5c494f1
Diffstat (limited to 'src/hnbgw_vty.c')
-rw-r--r--src/hnbgw_vty.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 0845ff7..1673c0c 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -105,6 +105,15 @@ DEFUN(show_talloc, show_talloc_cmd, "show talloc", SHOW_STR "Display talloc info
return CMD_SUCCESS;
}
+DEFUN(cfg_hnbgw_iuh_bind, cfg_hnbgw_iuh_bind_cmd, "bind A.B.C.D",
+ "Accept Iuh connections on local interface\n"
+ "Local interface IP address (default: " HNBGW_IUH_BIND_ADDR_DEFAULT ")")
+{
+ talloc_free((void*)g_hnb_gw->config.iuh_bind_addr);
+ g_hnb_gw->config.iuh_bind_addr = talloc_strdup(tall_hnb_ctx, argv[0]);
+ return CMD_SUCCESS;
+}
+
static int config_write_hnbgw(struct vty *vty)
{
vty_out(vty, "hnbgw%s", VTY_NEWLINE);
@@ -113,7 +122,14 @@ static int config_write_hnbgw(struct vty *vty)
static int config_write_hnbgw_iuh(struct vty *vty)
{
+ const char *addr;
+
vty_out(vty, " iuh%s", VTY_NEWLINE);
+
+ addr = g_hnb_gw->config.iuh_bind_addr;
+ if (addr && (strcmp(addr, HNBGW_IUH_BIND_ADDR_DEFAULT) != 0))
+ vty_out(vty, " bind %s%s", addr, VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -129,6 +145,7 @@ void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx)
install_element(HNBGW_NODE, &cfg_hnbgw_iuh_cmd);
install_node(&iuh_node, config_write_hnbgw_iuh);
vty_install_default(IUH_NODE);
+ install_element(IUH_NODE, &cfg_hnbgw_iuh_bind_cmd);
install_element_ve(&show_hnb_cmd);
install_element_ve(&show_ue_cmd);