diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-11-23 14:45:03 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-11-23 14:50:53 +0100 |
commit | 91314c10af9d034044540a30cba24766d6ee5e7a (patch) | |
tree | d313e5f70ae3c5de9a59448733e84f887ab58e85 | |
parent | ipaccess: Use LOGPITS macro in __handle_ts1_write (diff) | |
download | libosmo-abis-91314c10af9d034044540a30cba24766d6ee5e7a.tar.xz libosmo-abis-91314c10af9d034044540a30cba24766d6ee5e7a.zip |
ipaccess: Fix log error printed on wrong conditional branch
The signal link is set if fd is established (see osmo_fd_setup in
ipaccess.c).
This log message was introduced in 466c5467e2e95c04260cb6b933181a38d1d97bd5,
where the lifecycle worked a bit different than nowadays:
line->ops->sign_link_down() was called before the log line, so the code
expected by that time that the socket should have been freed by
sign_link_down(). That's no longer the case. In ipaccess_drop, we force
dropping so we release lower layers and then signal upper layers. Hence,
the log lines are misleading nowadays.
Change-Id: Ibc6554e6cacc9c71232238b4e6a17d749dfdd30a
-rw-r--r-- | src/input/ipaccess.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 593f9f0..48a427c 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -88,8 +88,7 @@ static int ipaccess_drop(struct osmo_fd *bfd, struct e1inp_line *line) /* Error case: we did not see any ID_RESP yet for this socket. */ if (bfd->fd != -1) { - LOGP(DLINP, LOGL_ERROR, "Forcing socket shutdown with " - "no signal link set\n"); + LOGPITS(e1i_ts, DLINP, LOGL_NOTICE, "Forcing socket shutdown\n"); osmo_fd_unregister(bfd); close(bfd->fd); bfd->fd = -1; @@ -101,6 +100,9 @@ static int ipaccess_drop(struct osmo_fd *bfd, struct e1inp_line *line) e1inp_line_put2(line, "ipa_bfd"); ret = -ENOENT; + } else { + LOGPITS(e1i_ts, DLINP, LOGL_ERROR, + "Forcing socket shutdown with no signal link set\n"); } msgb_free(e1i_ts->pending_msg); |