Ticket #664: add-missing-port-to-ipv6-address-in-management-interface.diff

File add-missing-port-to-ipv6-address-in-management-interface.diff, 948 bytes (added by furlongm, 7 years ago)
  • src/openvpn/mroute.c

    commit 4132939309d022a1847d169238eba37d32d8eb18
    Author: Marcus Furlong <furlongm@gmail.com>
    Date:   Thu Mar 10 15:46:40 2016 +1100
    
        add missing port to ipv6 address in management interface
    
    diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c
    index 850e336..5ac172a 100644
    a b mroute_addr_print_ex (const struct mroute_addr *ma, 
    426426          break;
    427427        case MR_ADDR_IPV6:
    428428          {
     429        struct buffer buf;
     430        int port;
     431        buf_set_read (&buf, maddr.addr, maddr.len);
    429432            buf_printf (&out, "%s",
    430433                  print_in6_addr( *(struct in6_addr*)&maddr.addr, 0, gc));
    431434            if (maddr.type & MR_WITH_NETBITS)
    432435              {
    433436                buf_printf (&out, "/%d", maddr.netbits);
    434437              }
     438        if (maddr.type & MR_WITH_PORT)
     439          {
     440        port = buf_read_u16 (&buf);
     441        if (port >= 0)
     442          buf_printf (&out, "#%d", port);
     443          }
    435444            }
    436445            break;
    437446          default: