Skip to content

Commit

Permalink
correct formatting of netbsd route commands
Browse files Browse the repository at this point in the history
  • Loading branch information
c0repwn3r committed Jul 11, 2023
1 parent af5e9b4 commit d34e47d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions overlay/tun_netbsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func (t *tun) Activate() error {
if err = exec.Command("/sbin/ifconfig", t.Device, t.cidr.String(), t.cidr.IP.String()).Run(); err != nil {
return fmt.Errorf("failed to run 'ifconfig': %s", err)
}
t.l.Debug("command: route", "-n", "add", "-net", t.cidr.String(), "-interface", t.Device)
if err = exec.Command("/sbin/route", "-n", "add", "-net", t.cidr.String(), "-interface", t.Device).Run(); err != nil {
t.l.Debug("command: route", "-n", "add", "-net", t.cidr.String(), t.cidr.IP.String())
if err = exec.Command("/sbin/route", "-n", "add", "-net", t.cidr.String(), t.cidr.IP.String()).Run(); err != nil {
return fmt.Errorf("failed to run 'route add': %s", err)
}
t.l.Debug("command: ifconfig", t.Device, "mtu", strconv.Itoa(t.MTU))
Expand All @@ -121,8 +121,8 @@ func (t *tun) Activate() error {
continue
}

t.l.Debug("command: route", "-n", "add", "-net", r.Cidr.String(), "-interface", t.Device)
if err = exec.Command("/sbin/route", "-n", "add", "-net", r.Cidr.String(), "-interface", t.Device).Run(); err != nil {
t.l.Debug("command: route", "-n", "add", "-net", r.Cidr.String(), t.cidr.IP.String())
if err = exec.Command("/sbin/route", "-n", "add", "-net", r.Cidr.String(), t.cidr.IP.String()).Run(); err != nil {
return fmt.Errorf("failed to run 'route add' for unsafe_route %s: %s", r.Cidr.String(), err)
}
}
Expand Down

0 comments on commit d34e47d

Please sign in to comment.