Diff for /embedaddon/quagga/lib/vty.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2012/10/09 09:22:28 version 1.1.1.3, 2013/07/21 23:54:39
Line 1612  vty_flush (struct thread *thread) Line 1612  vty_flush (struct thread *thread)
 static struct vty *  static struct vty *
 vty_create (int vty_sock, union sockunion *su)  vty_create (int vty_sock, union sockunion *su)
 {  {
     char buf[SU_ADDRSTRLEN];
   struct vty *vty;    struct vty *vty;
   
     sockunion2str(su, buf, SU_ADDRSTRLEN);
   
   /* Allocate new vty structure and set up default values. */    /* Allocate new vty structure and set up default values. */
   vty = vty_new ();    vty = vty_new ();
   vty->fd = vty_sock;    vty->fd = vty_sock;
   vty->type = VTY_TERM;    vty->type = VTY_TERM;
  vty->address = sockunion_su2str (su);  strcpy (vty->address, buf);
   if (no_password_check)    if (no_password_check)
     {      {
       if (restricted_mode)        if (restricted_mode)
Line 1693  vty_accept (struct thread *thread) Line 1696  vty_accept (struct thread *thread)
   int accept_sock;    int accept_sock;
   struct prefix *p = NULL;    struct prefix *p = NULL;
   struct access_list *acl = NULL;    struct access_list *acl = NULL;
  char *bufp;  char buf[SU_ADDRSTRLEN];
   
   accept_sock = THREAD_FD (thread);    accept_sock = THREAD_FD (thread);
   
Line 1719  vty_accept (struct thread *thread) Line 1722  vty_accept (struct thread *thread)
       if ((acl = access_list_lookup (AFI_IP, vty_accesslist_name)) &&        if ((acl = access_list_lookup (AFI_IP, vty_accesslist_name)) &&
           (access_list_apply (acl, p) == FILTER_DENY))            (access_list_apply (acl, p) == FILTER_DENY))
         {          {
           char *buf;  
           zlog (NULL, LOG_INFO, "Vty connection refused from %s",            zlog (NULL, LOG_INFO, "Vty connection refused from %s",
                (buf = sockunion_su2str (&su)));                sockunion2str (&su, buf, SU_ADDRSTRLEN));
          free (buf); 
           close (vty_sock);            close (vty_sock);
                       
           /* continue accepting connections */            /* continue accepting connections */
Line 1741  vty_accept (struct thread *thread) Line 1742  vty_accept (struct thread *thread)
       if ((acl = access_list_lookup (AFI_IP6, vty_ipv6_accesslist_name)) &&        if ((acl = access_list_lookup (AFI_IP6, vty_ipv6_accesslist_name)) &&
           (access_list_apply (acl, p) == FILTER_DENY))            (access_list_apply (acl, p) == FILTER_DENY))
         {          {
           char *buf;  
           zlog (NULL, LOG_INFO, "Vty connection refused from %s",            zlog (NULL, LOG_INFO, "Vty connection refused from %s",
                (buf = sockunion_su2str (&su)));                sockunion2str (&su, buf, SU_ADDRSTRLEN));
          free (buf); 
           close (vty_sock);            close (vty_sock);
                       
           /* continue accepting connections */            /* continue accepting connections */
Line 1767  vty_accept (struct thread *thread) Line 1766  vty_accept (struct thread *thread)
           safe_strerror (errno));            safe_strerror (errno));
   
   zlog (NULL, LOG_INFO, "Vty connection from %s",    zlog (NULL, LOG_INFO, "Vty connection from %s",
    (bufp = sockunion_su2str (&su)));        sockunion2str (&su, buf, SU_ADDRSTRLEN));
  if (bufp) 
    XFREE (MTYPE_TMP, bufp); 
   
   vty_create (vty_sock, &su);    vty_create (vty_sock, &su);
   
Line 2193  vty_close (struct vty *vty) Line 2190  vty_close (struct vty *vty)
   if (vty->fd > 0)    if (vty->fd > 0)
     close (vty->fd);      close (vty->fd);
   
   if (vty->address)  
     XFREE (MTYPE_TMP, vty->address);  
   if (vty->buf)    if (vty->buf)
     XFREE (MTYPE_VTY, vty->buf);      XFREE (MTYPE_VTY, vty->buf);
   

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>