Skip to content

Commit

Permalink
datapath-windows: Add assert to ethHdr in OvsActionMplsPush
Browse files Browse the repository at this point in the history
`ethHdr` cannot be NULL because we did a partial copy before it.

Add an assert to keep the static analysis happy.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Shashank Ram <shashank08@gmail.com>
  • Loading branch information
Alin Serdean authored and aserdean committed Nov 29, 2017
1 parent 960b789 commit c249e3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions datapath-windows/ovsext/Actions.c
Expand Up @@ -1237,6 +1237,7 @@ OvsActionMplsPush(OvsForwardingContext *ovsFwdCtx,
ASSERT(mdlLen >= MPLS_HLEN);

ethHdr = (EthHdr *)(bufferStart + curMdlOffset);
ASSERT(ethHdr);
RtlMoveMemory(ethHdr, (UINT8*)ethHdr + MPLS_HLEN, sizeof(*ethHdr));
ethHdr->Type = mpls->mpls_ethertype;

Expand Down

0 comments on commit c249e3e

Please sign in to comment.