[ovs-dev] [PATCH v2 4/7] datapath-windows: Add assert to ethHdr in OvsActionMplsPush

Shashank Ram shashank08 at gmail.com
Tue Nov 7 02:12:23 UTC 2017


On Mon, Nov 6, 2017 at 7:33 AM, Alin Gabriel Serdean <aserdean at ovn.org>
wrote:

> From: Alin Serdean <aserdean at cloudbasesolutions.com>
>
> `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 at cloudbasesolutions.com>
> ---
> v2: switch from if to assert
> ---
>  datapath-windows/ovsext/Actions.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/
> Actions.c
> index 0af4a66..9bbc787 100644
> --- a/datapath-windows/ovsext/Actions.c
> +++ b/datapath-windows/ovsext/Actions.c
> @@ -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;
>
> --
> 2.10.2.windows.1
>
> _______________________________________________
> Acked-by: Shashank Ram <shashank08 at gmail.com>
>


More information about the dev mailing list