IPA: remove automatic reconnect logic
When an IPA link is in client (BTS) mode, we should not automatically
re-connect in the lowest (ipa) layer. Instead, we properly close the
socket if the link is dead, and we call link->updown_cb() to notify
the user that the link is down.
The e1inp/ipaccess layer translates this into a line->sign_link_down()
callback that propagates up to the user.
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 6663b9f..cf0cc15 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -800,6 +800,17 @@
return nmsg2;
}
+static void ipaccess_bts_updown_cb(struct ipa_client_conn *link, int up)
+{
+ struct e1inp_line *line = link->line;
+
+ if (up)
+ return;
+
+ if (line->ops->sign_link_down)
+ line->ops->sign_link_down(line);
+}
+
static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg)
{
struct ipaccess_head *hh = (struct ipaccess_head *) msg->data;
@@ -973,7 +984,7 @@
E1INP_SIGN_OML,
line->ops->cfg.ipa.addr,
IPA_TCP_PORT_OML,
- NULL,
+ ipaccess_bts_updown_cb,
ipaccess_bts_read_cb,
ipaccess_bts_write_cb,
line);
@@ -1007,7 +1018,7 @@
&line->ts[E1INP_SIGN_RSL-1],
E1INP_SIGN_RSL,
rem_addr, rem_port,
- NULL,
+ ipaccess_bts_updown_cb,
ipaccess_bts_read_cb,
ipaccess_bts_write_cb,
line);