diff options
author | Alin Serdean <aserdean@cloudbasesolutions.com> | 2017-01-26 23:38:17 +0000 |
---|---|---|
committer | Gurucharan Shetty <guru@ovn.org> | 2017-01-27 13:53:06 -0800 |
commit | e5c6c7f5082dfe6a55e04da85afd206b545d41f5 (patch) | |
tree | 44b8ee663c3def3ab8d8c11a1b1df24007902e9c /datapath-windows | |
parent | c412927026f2a358938fc673a2358700d2372503 (diff) | |
download | openvswitch-e5c6c7f5082dfe6a55e04da85afd206b545d41f5.tar.gz |
datapath-windows: OvsUpdateIPv4Header remove unnecessary addition
bufferStart can be used directly to access the data of the net buffer.
Add the MDL offset to save unnecessary additions.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows')
-rw-r--r-- | datapath-windows/ovsext/Actions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/datapath-windows/ovsext/Actions.c b/datapath-windows/ovsext/Actions.c index b4a286b5a..760888e32 100644 --- a/datapath-windows/ovsext/Actions.c +++ b/datapath-windows/ovsext/Actions.c @@ -1390,13 +1390,13 @@ OvsUpdateIPv4Header(OvsForwardingContext *ovsFwdCtx, mdlLen -= curMdlOffset; ASSERT(mdlLen >= hdrSize); } - - ipHdr = (IPHdr *)(bufferStart + curMdlOffset + layers->l3Offset); + bufferStart += curMdlOffset; + ipHdr = (IPHdr *)(bufferStart + layers->l3Offset); if (layers->isTcp) { - tcpHdr = (TCPHdr *)(bufferStart + curMdlOffset + layers->l4Offset); + tcpHdr = (TCPHdr *)(bufferStart + layers->l4Offset); } else if (layers->isUdp) { - udpHdr = (UDPHdr *)(bufferStart + curMdlOffset + layers->l4Offset); + udpHdr = (UDPHdr *)(bufferStart + layers->l4Offset); } /* |