@@ -62,12 +62,6 @@ typedef struct _OVS_VPORT_EXT_INFO {
* that is, pure 802.2 frames. */
#define OVSWIN_DL_TYPE_NONE 0x5ff
-/* Fragment bits, used for IPv4 and IPv6, always zero for non-IP flows. */
-#define OVSWIN_NW_FRAG_ANY (1 << 0) /* Set for any IP frag. */
-#define OVSWIN_NW_FRAG_LATER (1 << 1) /* Set for IP frag with nonzero
- * offset. */
-#define OVSWIN_NW_FRAG_MASK (OVSWIN_NW_FRAG_ANY | OVSWIN_NW_FRAG_LATER)
-
typedef struct L4Key {
ovs_be16 tpSrc; /* TCP/UDP/SCTP source port. */
ovs_be16 tpDst; /* TCP/UDP/SCTP destination port. */
@@ -1785,12 +1785,12 @@ OvsExtractFlow(const NET_BUFFER_LIST *packet,
ipKey->nwTos = nh->tos;
if (nh->frag_off & htons(IP_MF | IP_OFFSET)) {
- ipKey->nwFrag = OVSWIN_NW_FRAG_ANY;
+ ipKey->nwFrag = OVS_FRAG_TYPE_FIRST;
if (nh->frag_off & htons(IP_OFFSET)) {
- ipKey->nwFrag |= OVSWIN_NW_FRAG_LATER;
+ ipKey->nwFrag = OVS_FRAG_TYPE_LATER;
}
} else {
- ipKey->nwFrag = 0;
+ ipKey->nwFrag = OVS_FRAG_TYPE_NONE;
}
ipKey->nwTtl = nh->ttl;
@@ -108,7 +108,7 @@ OvsParseIPv6(const NET_BUFFER_LIST *packet,
((nh->flow_lbl[0] & 0x0F) << 16) | (nh->flow_lbl[1] << 8) | nh->flow_lbl[2];
flow->nwTtl = nh->hop_limit;
flow->nwProto = SOCKET_IPPROTO_NONE;
- flow->nwFrag = 0;
+ flow->nwFrag = OVS_FRAG_TYPE_NONE;
// Parse extended headers and compute L4 offset
ofs += sizeof(IPv6Hdr);
@@ -161,9 +161,9 @@ OvsParseIPv6(const NET_BUFFER_LIST *packet,
/* We only process the first fragment. */
if (fragHdr->offlg != htons(0)) {
if ((fragHdr->offlg & IP6F_OFF_HOST_ORDER_MASK) == htons(0)) {
- flow->nwFrag = OVSWIN_NW_FRAG_ANY;
+ flow->nwFrag = OVS_FRAG_TYPE_FIRST;
} else {
- flow->nwFrag |= OVSWIN_NW_FRAG_LATER;
+ flow->nwFrag = OVS_FRAG_TYPE_LATER;
nextHdr = SOCKET_IPPROTO_FRAGMENT;
break;
}
Currently in the case of IP fragmentation we send to the userspace that the flag for the last fragment is 3 when it actually should be a value between 0..2. This patch fixes the problem and also uses the values used in the common header of the datapath. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> --- This patch is intended for branch-2.4 as well --- datapath-windows/ovsext/DpInternal.h | 6 ------ datapath-windows/ovsext/Flow.c | 6 +++--- datapath-windows/ovsext/PacketParser.c | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-)