1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

fix(wg): cidr parsing

This commit is contained in:
源文雨
2024-07-13 02:13:50 +09:00
parent 282cb387cb
commit f25df3c0d7

View File

@@ -71,6 +71,9 @@ func (wg *WG) init(srcport, dstport uint16) {
}
for _, p := range wg.c.Peers {
for _, ip := range p.AllowedIPs {
if len(ip) == 0 || ip[0] == 'x' {
continue
}
ipnet, _, err := net.ParseCIDR(ip)
if err != nil {
panic(err)