Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2021 02:11:48 GMT
From:      Philip Paeps <philip@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0646b83f0779 - stable/13 - ifconfig: fix incorrect wg allowed-ips netmask
Message-ID:  <202102160211.11G2BmVu023168@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by philip:

URL: https://cgit.FreeBSD.org/src/commit/?id=0646b83f0779260256e03a11c7bc2e6bcfefa694

commit 0646b83f0779260256e03a11c7bc2e6bcfefa694
Author:     Michael Chiu <nyan@myuji.xyz>
AuthorDate: 2021-02-15 00:38:26 +0000
Commit:     Philip Paeps <philip@FreeBSD.org>
CommitDate: 2021-02-16 00:47:25 +0000

    ifconfig: fix incorrect wg allowed-ips netmask
    
    Currently when peer information is displayed with `ifconfig wgN peer ..`
    or `ifconfig wgN peer-list`, the netmask of the first `allowed-ips` will
    be used as the netmask of all CIDR in `allowed-ips`.  For example, if
    the list is `192.168.1.0/24, 172.16.0.0/16`, it will display as
    `192.168.1.0/24, 172.16.0.0/24`. While this does not affect the actual
    functionality, it is very confusing.
    
    Submitted by:   Michael Chiu <nyan -at- myuji.xyz>
    Reviewed by:    grehan
    Differential Revision: https://reviews.freebsd.org/D28655
    
    (cherry picked from commit be2003ccfa1b12f372fa1329c38c29fe035f232f)
---
 sbin/ifconfig/ifwg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ifconfig/ifwg.c b/sbin/ifconfig/ifwg.c
index 8956e3427dd1..a2b22d2dfbef 100644
--- a/sbin/ifconfig/ifwg.c
+++ b/sbin/ifconfig/ifwg.c
@@ -309,7 +309,7 @@ dump_peer(const nvlist_t *nvl_peer)
 
 		sa = __DECONST(void *, &aips[i].a_addr);
 		bitmask = __DECONST(void *,
-		    ((const struct sockaddr *)&aips->a_mask)->sa_data);
+		    ((const struct sockaddr *)&(&aips[i])->a_mask)->sa_data);
 		family = aips[i].a_addr.ss_family;
 		getnameinfo(sa, sa->sa_len, addr_buf, INET6_ADDRSTRLEN, NULL,
 		    0, NI_NUMERICHOST);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102160211.11G2BmVu023168>