mirror of
https://github.com/hyprspace/hyprspace.git
synced 2026-09-12 19:51:07 +05:00
allow non-CIDR IP addresses in route subcommand
This commit is contained in:
parent
0c8f66c404
commit
ec8ca35f2e
@ -114,7 +114,14 @@ func (hsr *HyprspaceRPC) Route(args *RouteArgs, reply *RouteReply) error {
|
||||
}
|
||||
_, network, err := net.ParseCIDR(args.Args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
addr := net.ParseIP(args.Args[0])
|
||||
if addr == nil {
|
||||
return err
|
||||
}
|
||||
network = &net.IPNet{
|
||||
IP: addr,
|
||||
Mask: []byte{255, 255, 255, 255},
|
||||
}
|
||||
}
|
||||
target, found := config.FindPeerByCLIRef(hsr.config.Peers, args.Args[1])
|
||||
if !found {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user