From c598aa63c5711a766cf7f82474ab60e4e7d87019 Mon Sep 17 00:00:00 2001 From: Alin Serdean Date: Mon, 5 Jan 2015 19:17:01 +0000 Subject: datapath-windows: set the nlBuf tail properly Move the the tail of the netlink buffer accordingly to the input data. Currently _MapFlowStatsToNlStats overrides the netlink header information. Signed-off-by: Alin Gabriel Serdean Acked-by: Nithin Raju Signed-off-by: Ben Pfaff --- datapath-windows/ovsext/Flow.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'datapath-windows/ovsext/Flow.c') diff --git a/datapath-windows/ovsext/Flow.c b/datapath-windows/ovsext/Flow.c index 044fde57c..d3de8cc45 100644 --- a/datapath-windows/ovsext/Flow.c +++ b/datapath-windows/ovsext/Flow.c @@ -433,6 +433,7 @@ _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, RtlZeroMemory(&getOutput, sizeof(OvsFlowGetOutput)); UINT32 keyAttrOffset = 0; UINT32 tunnelKeyAttrOffset = 0; + BOOLEAN ok; if (usrParamsCtx->inputLength > usrParamsCtx->outputLength) { /* Should not be the case. @@ -506,8 +507,12 @@ _FlowNlGetCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, /* Input already has all the attributes for the flow key. * Lets copy the values back. */ - RtlCopyMemory(usrParamsCtx->outputBuffer, usrParamsCtx->inputBuffer, - usrParamsCtx->inputLength); + ok = NlMsgPutTail(&nlBuf, (PCHAR)(usrParamsCtx->inputBuffer), + usrParamsCtx->inputLength); + if (!ok) { + OVS_LOG_ERROR("Could not copy the data to the buffer tail"); + goto done; + } rc = _MapFlowStatsToNlStats(&nlBuf, &((getOutput.info).stats)); if (rc != STATUS_SUCCESS) { -- cgit v1.2.1