Skip to content

Commit

Permalink
Fix: should Unmap ip after AddrFromSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Aug 1, 2023
1 parent e1ec0d2 commit 10f4d53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
srcIP, ok := netip.AddrFromSlice(metadata.SrcIP)
srcPort, err := strconv.ParseUint(metadata.SrcPort, 10, 16)
if ok && err == nil && metadata.OriginDst.IsValid() {
srcIP = srcIP.Unmap()
path, err := P.FindProcessPath(metadata.NetWork.String(), netip.AddrPortFrom(srcIP, uint16(srcPort)), metadata.OriginDst)
if err != nil {
log.Debugln("[Process] find process %s: %v", metadata.String(), err)
Expand Down

0 comments on commit 10f4d53

Please sign in to comment.