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

Isaku Yamahata yamahata at valinux.co.jp
Tue Dec 25 06:52:45 UTC 2012


On Mon, Dec 24, 2012 at 11:35:14AM +0900, Simon Horman wrote:
> 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);

transport header is not set until here.
To be honest, I'm not sure which header the transport header should point to.
Will it be referenced later? (I'm going to review the later patch, though.)
-- 
yamahata



More information about the dev mailing list