summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Conntrack.c
diff options
context:
space:
mode:
authorAnand Kumar <kumaranand@vmware.com>2017-05-04 15:12:51 -0700
committerBen Pfaff <blp@ovn.org>2017-05-08 10:01:18 -0400
commit45bde0177ad31571e2d4bb5d98b616ddc6131fab (patch)
tree4ae2d2868960f924cb618165c37b337e02893ddc /datapath-windows/ovsext/Conntrack.c
parent0b5166dca34e6d16c09fa3657779a1a9863b77a9 (diff)
downloadopenvswitch-45bde0177ad31571e2d4bb5d98b616ddc6131fab.tar.gz
datapath-windows: Added Ipv4 fragments support in Conntrack
This patch adds support for tracking Ipv4 fragments in conntrack module. Individual fragments are not tracked and are consumed by the fragmentation/reassembly. Only the reassembled Ipv4 datagram is tracked and treated as a single ct entry. Signed-off-by: Anand Kumar <kumaranand@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Diffstat (limited to 'datapath-windows/ovsext/Conntrack.c')
-rw-r--r--datapath-windows/ovsext/Conntrack.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/datapath-windows/ovsext/Conntrack.c b/datapath-windows/ovsext/Conntrack.c
index 8658910c1..dce0c1bcc 100644
--- a/datapath-windows/ovsext/Conntrack.c
+++ b/datapath-windows/ovsext/Conntrack.c
@@ -15,6 +15,7 @@
*/
#include "Conntrack.h"
+#include "IpFragment.h"
#include "Jhash.h"
#include "PacketParser.h"
#include "Event.h"
@@ -317,13 +318,20 @@ OvsCtEntryExpired(POVS_CT_ENTRY entry)
}
static __inline NDIS_STATUS
-OvsDetectCtPacket(OvsFlowKey *key)
+OvsDetectCtPacket(OvsForwardingContext *fwdCtx,
+ OvsFlowKey *key,
+ PNET_BUFFER_LIST *newNbl)
{
/* Currently we support only Unfragmented TCP packets */
switch (ntohs(key->l2.dlType)) {
case ETH_TYPE_IPV4:
if (key->ipKey.nwFrag != OVS_FRAG_TYPE_NONE) {
- return NDIS_STATUS_NOT_SUPPORTED;
+ return OvsProcessIpv4Fragment(fwdCtx->switchContext,
+ &fwdCtx->curNbl,
+ fwdCtx->completionList,
+ fwdCtx->fwdDetail->SourcePortId,
+ key->tunKey.tunnelId,
+ newNbl);
}
if (key->ipKey.nwProto == IPPROTO_TCP
|| key->ipKey.nwProto == IPPROTO_UDP
@@ -707,6 +715,7 @@ OvsCtExecute_(PNET_BUFFER_LIST curNbl,
*---------------------------------------------------------------------------
* OvsExecuteConntrackAction
* Executes Conntrack actions XXX - Add more
+ * For the Ipv4 fragments, consume the orginal fragment NBL
*---------------------------------------------------------------------------
*/
NDIS_STATUS
@@ -723,10 +732,10 @@ OvsExecuteConntrackAction(OvsForwardingContext *fwdCtx,
PCHAR helper = NULL;
PNET_BUFFER_LIST curNbl = fwdCtx->curNbl;
OVS_PACKET_HDR_INFO *layers = &fwdCtx->layers;
-
+ PNET_BUFFER_LIST newNbl = NULL;
NDIS_STATUS status;
- status = OvsDetectCtPacket(key);
+ status = OvsDetectCtPacket(fwdCtx, key, &newNbl);
if (status != NDIS_STATUS_SUCCESS) {
return status;
}
@@ -765,9 +774,9 @@ OvsExecuteConntrackAction(OvsForwardingContext *fwdCtx,
/* Force implicitly means commit */
commit = TRUE;
}
-
- status = OvsCtExecute_(curNbl, key, layers, commit, force,
- zone, mark, labels, helper);
+ /* If newNbl is not allocated, use the current Nbl*/
+ status = OvsCtExecute_(newNbl != NULL ? newNbl : curNbl, key, layers,
+ commit, force, zone, mark, labels, helper);
return status;
}