Skip to content

Commit

Permalink
update conntrack with proper flow hash (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
varks authored Sep 17, 2018
1 parent e74b236 commit 0d66ab5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controller/internal/enforcer/nfqdatapath/datapath_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ func (d *Datapath) processApplicationSynAckPacket(tcpPacket *packet.Packet, cont
// packets from this connection.
if conn.GetState() == connection.TCPData && !conn.ServiceConnection {
if err := d.conntrackHdl.ConntrackTableUpdateMark(
tcpPacket.DestinationAddress.String(),
tcpPacket.SourceAddress.String(),
tcpPacket.DestinationAddress.String(),
tcpPacket.IPProto,
tcpPacket.DestinationPort,
tcpPacket.SourcePort,
tcpPacket.DestinationPort,
constants.DefaultConnMark,
); err != nil {
zap.L().Error("Failed to update conntrack entry for flow",
Expand Down Expand Up @@ -624,11 +624,11 @@ func (d *Datapath) processNetworkSynAckPacket(context *pucontext.PUContext, conn

// Revert the connmarks - dealing with retransmissions
if cerr := d.conntrackHdl.ConntrackTableUpdateMark(
tcpPacket.SourceAddress.String(),
tcpPacket.DestinationAddress.String(),
tcpPacket.SourceAddress.String(),
tcpPacket.IPProto,
tcpPacket.SourcePort,
tcpPacket.DestinationPort,
tcpPacket.SourcePort,
0,
); cerr != nil {
zap.L().Error("Failed to update conntrack table for flow",
Expand Down Expand Up @@ -774,11 +774,11 @@ func (d *Datapath) processNetworkAckPacket(context *pucontext.PUContext, conn *c

if !conn.ServiceConnection {
if err := d.conntrackHdl.ConntrackTableUpdateMark(
tcpPacket.SourceAddress.String(),
tcpPacket.DestinationAddress.String(),
tcpPacket.SourceAddress.String(),
tcpPacket.IPProto,
tcpPacket.SourcePort,
tcpPacket.DestinationPort,
tcpPacket.SourcePort,
constants.DefaultConnMark,
); err != nil {
zap.L().Error("Failed to update conntrack table after ack packet")
Expand Down

0 comments on commit 0d66ab5

Please sign in to comment.