[ovs-dev] [PATCH 1/2] datapath: Do not read tcp flags from a later fragment.

Pravin Shelar pshelar at nicira.com
Fri Feb 7 00:12:51 UTC 2014


On Thu, Feb 6, 2014 at 3:13 PM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>     Only the first IP fragment can have a TCP header, check for this.
>
Is ip.proto still set to IPPROTO_TCP in this case?

>     Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
> ---
>  datapath/flow.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/datapath/flow.c b/datapath/flow.c
> index 8be3801..abe6789 100644
> --- a/datapath/flow.c
> +++ b/datapath/flow.c
> @@ -74,6 +74,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
>
>         if ((flow->key.eth.type == htons(ETH_P_IP) ||
>              flow->key.eth.type == htons(ETH_P_IPV6)) &&
> +           flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
>             flow->key.ip.proto == IPPROTO_TCP &&
>             likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
>                 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list