[ovs-dev] [PATCH 08/19] datapath: Update skb transport and network headers on MPLS extraction

Simon Horman horms at verge.net.au
Mon Dec 24 02:35:14 UTC 2012


When an MPLS header is extracted the skb is updated.
This should include updating the transport and network headers.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 datapath/flow.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/datapath/flow.c b/datapath/flow.c
index fa9c86b..3c83426 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -738,6 +738,12 @@ int ovs_flow_extract(struct sk_buff *skb, u16 in_port, struct sw_flow_key *key,
 
 		key_len = SW_FLOW_KEY_OFFSET(mpls.top_label);
 		memcpy(&key->mpls.top_label, skb_network_header(skb), MPLS_HLEN);
+
+		/* Update network and transport headers */
+		skb_set_network_header(skb, skb_network_header(skb) -
+				       skb->data + MPLS_HLEN);
+		skb_set_transport_header(skb, skb_transport_header(skb) -
+				       skb->data + MPLS_HLEN);
 	} else if (key->eth.type == htons(ETH_P_IPV6)) {
 		int nh_len;             /* IPv6 Header + Extensions */
 
-- 
1.7.10.4




More information about the dev mailing list