]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: log source of vty connections (bug #566)
authorheasley <heas@shrubbery.net>
Mon, 7 Dec 2009 13:41:14 +0000 (16:41 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 7 Dec 2009 13:41:14 +0000 (16:41 +0300)
heasley: I've used this for a while to track usage.

lib/vty.c

index 30a94e1128bf9a05d77ca3c5da1f39ddc2a79cb0..e4818eb682f34fdd9a5bce6c509f09a8d6ae3962 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1692,6 +1692,7 @@ vty_accept (struct thread *thread)
   int accept_sock;
   struct prefix *p = NULL;
   struct access_list *acl = NULL;
+  char *bufp;
 
   accept_sock = THREAD_FD (thread);
 
@@ -1764,6 +1765,11 @@ vty_accept (struct thread *thread)
     zlog (NULL, LOG_INFO, "can't set sockopt to vty_sock : %s", 
          safe_strerror (errno));
 
+  zlog (NULL, LOG_INFO, "Vty connection from %s",
+    (bufp = sockunion_su2str (&su)));
+  if (bufp)
+    XFREE (MTYPE_TMP, bufp);
+
   vty = vty_create (vty_sock, &su);
 
   return 0;