mirror of
https://github.com/ngoduykhanh/wireguard-ui
synced 2024-06-04 23:12:24 +02:00
Fix generating IPv6 address (#105)
This commit is contained in:
parent
59abd1506f
commit
c1d541b78f
|
@ -621,8 +621,12 @@ func SuggestIPAllocation(db store.IStore) echo.HandlerFunc {
|
|||
fmt.Sprintf("Cannot suggest ip allocation: failed to get available ip from network %s", cidr),
|
||||
})
|
||||
}
|
||||
if (strings.Contains(ip, ":")) {
|
||||
suggestedIPs = append(suggestedIPs, fmt.Sprintf("%s/128", ip))
|
||||
} else {
|
||||
suggestedIPs = append(suggestedIPs, fmt.Sprintf("%s/32", ip))
|
||||
}
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, suggestedIPs)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue