Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hop/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewClient(cfg HopClientConfig) error {

go hopClient.cleanUp()

iface, err := newTun("")
iface, err := newTun()
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions hop/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ var invalidAddr = errors.New("Invalid device ip address")

var tun_peer net.IP

func newTun(name string) (iface *water.Interface, err error) {
func newTun() (iface *water.Interface, err error) {

iface, err = water.NewTUN(name)
iface, err = water.New(water.Config{})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion hop/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func NewServer(cfg HopServerConfig) error {
hopServer.toNet = make([]chan *udpPacket, (cfg.HopEnd - cfg.HopStart + 1))
hopServer.ippool = new(hopIPPool)

iface, err := newTun("")
iface, err := newTun()
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/chnroute-up.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -

OLDGW=$(ip route show 0/0 | head -n1 | grep 'via' | grep -Po '\d+\.\d+\.\d+\.\d+')
OLDGW=$(ip route show 0/0 | awk '{print $3}')

if [ $OLDGW == '' ]; then
exit 0
Expand Down