Skip to content

Commit a2f5e53

Browse files
committed
1
1 parent eed0983 commit a2f5e53

File tree

1 file changed

+1
-25
lines changed
  • components/ws-daemon/nsinsider

1 file changed

+1
-25
lines changed

components/ws-daemon/nsinsider/main.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ func main() {
288288
Mask: mask.Mask,
289289
}
290290

291-
masqueradeAddr := net.IPNet{
292-
IP: vethIpNet.IP.Mask(mask.Mask),
293-
Mask: mask.Mask,
294-
}
295-
296291
targetPid := c.Int("target-pid")
297292

298293
eth0, err := netlink.LinkByName(containerIf)
@@ -342,25 +337,7 @@ func main() {
342337
Table: nat,
343338
Chain: postrouting,
344339
Exprs: []expr.Any{
345-
&expr.Payload{
346-
DestRegister: 1,
347-
Base: expr.PayloadBaseNetworkHeader,
348-
Offset: 12,
349-
Len: net.IPv4len,
350-
},
351-
&expr.Bitwise{
352-
SourceRegister: 1,
353-
DestRegister: 1,
354-
Len: net.IPv4len,
355-
Mask: masqueradeAddr.Mask,
356-
Xor: net.IPv4Mask(0, 0, 0, 0),
357-
},
358-
&expr.Cmp{
359-
Op: expr.CmpOpEq,
360-
Register: 1,
361-
Data: masqueradeAddr.IP.To4(),
362-
},
363-
&expr.Meta{Key: expr.MetaKeyOIFNAME, Register: 1},
340+
&expr.Meta{Key: expr.MetaKeyIIFNAME, Register: 1},
364341
&expr.Cmp{
365342
Op: expr.CmpOpEq,
366343
Register: 1,
@@ -426,7 +403,6 @@ func main() {
426403
},
427404
},
428405
})
429-
430406
if err := nc.Flush(); err != nil {
431407
return xerrors.Errorf("failed to apply nftables: %v", err)
432408
}

0 commit comments

Comments
 (0)