Skip to content

Commit bd393db

Browse files
committed
better comparison method
1 parent 7a61f97 commit bd393db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/transport/udp/udp.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package udp
44

55
import (
6-
"bytes"
76
"fmt"
87
"log"
98
"net"
@@ -411,7 +410,7 @@ func sendUnreachable(packet *stack.PacketBuffer, s *stack.Stack) {
411410
}
412411

413412
// The IPTables DNAT rule does not properly apply to these ICMP return packets, need to manually fake source IP in two places
414-
if LocalhostIP.IsValid() && bytes.Equal(ipv4Layer.DstIP, net.ParseIP("127.0.0.1").To4()) {
413+
if LocalhostIP.IsValid() && ipv4Layer.DstIP.Equal(net.ParseIP("127.0.0.1").To4()) {
415414
fakeSource = true
416415
}
417416

0 commit comments

Comments
 (0)