Skip to content

Commit

Permalink
fix(wg): cidr parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 12, 2024
1 parent 282cb38 commit f25df3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions upper/services/wg/wg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f25df3c

Please sign in to comment.