f-28: fix: debug somme minor errors
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
b41b4f2518
commit
732a293857
3 changed files with 14 additions and 9 deletions
|
|
@ -15,7 +15,13 @@ func GetDefaultGateway() (net.IP, error) {
|
|||
return nil, fmt.Errorf("list routes: %w", err)
|
||||
}
|
||||
for _, r := range routes {
|
||||
if r.Dst == nil && r.Gw != nil {
|
||||
if r.Gw == nil {
|
||||
continue
|
||||
}
|
||||
if r.Dst == nil {
|
||||
return r.Gw, nil
|
||||
}
|
||||
if ones, _ := r.Dst.Mask.Size(); ones == 0 {
|
||||
return r.Gw, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue