mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-27 14:20:27 +08:00
fix(wg): cidr parsing
This commit is contained in:
@@ -71,6 +71,9 @@ func (wg *WG) init(srcport, dstport uint16) {
|
|||||||
}
|
}
|
||||||
for _, p := range wg.c.Peers {
|
for _, p := range wg.c.Peers {
|
||||||
for _, ip := range p.AllowedIPs {
|
for _, ip := range p.AllowedIPs {
|
||||||
|
if len(ip) == 0 || ip[0] == 'x' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
ipnet, _, err := net.ParseCIDR(ip)
|
ipnet, _, err := net.ParseCIDR(ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user