X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fdatapath.c;h=a34049f931383fd52478b182531fa815476261a8;hb=e2e744a852da97d86594b6ba4b6efeef57086fcf;hp=32572c6f9d5a2bced7cdc005a3e4d0ec45cc1540;hpb=38c6ecbc8d3664daed077617bb3b3508ba8aa767;p=openvswitch diff --git a/datapath/datapath.c b/datapath/datapath.c index 32572c6f..a34049f9 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -547,16 +547,21 @@ void dp_process_received_packet(struct dp_port *p, struct sk_buff *skb) struct sw_flow *flow; struct sw_flow_actions *acts; struct loop_counter *loop; + int error; OVS_CB(skb)->dp_port = p; /* Extract flow from 'skb' into 'key'. */ - if (flow_extract(skb, p ? p->port_no : ODPP_NONE, &key)) { - if (dp->drop_frags) { - kfree_skb(skb); - stats_counter_off = offsetof(struct dp_stats_percpu, n_frags); - goto out; - } + error = flow_extract(skb, p ? p->port_no : ODPP_NONE, &key); + if (unlikely(error)) { + kfree_skb(skb); + return; + } + + if (OVS_CB(skb)->is_frag && dp->drop_frags) { + kfree_skb(skb); + stats_counter_off = offsetof(struct dp_stats_percpu, n_frags); + goto out; } /* Look up flow. */ @@ -1360,7 +1365,9 @@ static int do_execute(struct datapath *dp, const struct odp_execute *execute) else skb->protocol = htons(ETH_P_802_2); - flow_extract(skb, execute->in_port, &key); + err = flow_extract(skb, execute->in_port, &key); + if (err) + goto error_free_skb; rcu_read_lock(); err = execute_actions(dp, skb, &key, actions->actions,