From 55dc2edc89c1a85187ef8aafc09f7d922383231f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 19 Sep 2016 14:10:25 +0200 Subject: log telnet bind address and port Log 'telnet at 1.2.3.4 5678' from telnet_init*. All callers can now drop any extra 'VTY at 1.2.3.4 5678' logging. Change-Id: I1da7b9076311d9458caea732fc0daace6533a3fd --- src/vty/telnet_interface.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index 50b08c8a..e86a6b13 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -86,7 +86,14 @@ int telnet_init_dynif(void *tall_ctx, void *priv, const char *ip, int port) server_socket.data = priv; - return (rc < 0) ? -1 : 0; + if (rc < 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "Cannot bind telnet at %s %d\n", + ip, port); + return -1; + } + + LOGP(DLGLOBAL, LOGL_NOTICE, "telnet at %s %d\n", ip, port); + return 0; } extern struct host host; -- cgit v1.2.3