diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-11-09 00:13:21 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-11-09 01:04:04 +0100 |
commit | 9294c40f14b41bbaf21253123ebc1e0e90f93250 (patch) | |
tree | ccadea1c9957ac1e46e0f2c9043c7b2edcfc4764 /src | |
parent | 0a94e57b72e5d1445b8a92538c8091b474fef445 (diff) |
client: disconnect before connecting the connection
With the VTY a user can write connect, connect, connect and this
would lead to leaking fds. Always close the connection.
Change-Id: Iab94dc2fd28496bf5fd8ceb5611f9e6505ccae1b
Diffstat (limited to 'src')
-rw-r--r-- | src/osmo_client_network.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/osmo_client_network.c b/src/osmo_client_network.c index f9303e9..4ecb1ca 100644 --- a/src/osmo_client_network.c +++ b/src/osmo_client_network.c @@ -220,6 +220,8 @@ void osmo_client_connect(struct osmo_pcap_client_conn *conn) { int fd; + osmo_client_disconnect(conn); + conn->wqueue.read_cb = read_cb; conn->wqueue.write_cb = write_cb; conn->wqueue.bfd.when = BSC_FD_READ; |