Skip to content

Commit

Permalink
fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
uoosef committed Jan 31, 2024
1 parent 59b4d28 commit 6cb2305
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func runWarpInWarp(bindAddress, endpoint string, verbose bool) {
if err != nil {
log.Fatal("There are no free udp ports on Device!")
}

err = wiresocks.NewVtunUDPForwarder(virtualEndpointBindAddress, "162.159.195.1:2408", vTUN, mtu+100)
addr, _ := wiresocks.ResolveIPPAndPort("engage.cloudflareclient.com:2408")
err = wiresocks.NewVtunUDPForwarder(virtualEndpointBindAddress, addr, vTUN, mtu+100)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion warp/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ GENERATE:
}
ip = net.IPv4(r[0], r[1], r[2], r[3])

if ip.Equal(ipnet.IP) /*|| ip.Equal(broadcast) */ {
if ip.Equal(ipnet.IP) || r[3] == 255 {
// we got unlucky. The host portion of our ipv4 address was
// either all 0s (the network address) or all 1s (the broadcast address)
goto GENERATE
Expand Down
4 changes: 2 additions & 2 deletions wiresocks/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func resolveIP(ip string) (*net.IPAddr, error) {
return net.ResolveIPAddr("ip", ip)
}

func resolveIPPAndPort(addr string) (string, error) {
func ResolveIPPAndPort(addr string) (string, error) {
if addr == "engage.cloudflareclient.com:2408" {
// Define your specific list of port numbers
ports := []int{500, 854, 859, 864, 878, 880, 890, 891, 894, 903, 908, 928, 934, 939, 942,
Expand Down Expand Up @@ -243,7 +243,7 @@ func ParsePeers(cfg *ini.File, peers *[]PeerConfig, endpoint string) error {
if endpoint != "notset" {
peer.Endpoint = &endpoint
} else {
decoded, err = resolveIPPAndPort(strings.ToLower(value))
decoded, err = ResolveIPPAndPort(strings.ToLower(value))
if err != nil {
return err
}
Expand Down

0 comments on commit 6cb2305

Please sign in to comment.