From: Justin Pettit Date: Thu, 27 Jun 2013 00:13:33 +0000 (-0700) Subject: netflow: Only un-wildcard IPv4 packets. X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~18 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=9b658910ab3c709f05f8d986f13aeae9bc53b233 netflow: Only un-wildcard IPv4 packets. NetFlow v5 only supports IPv4, so don't bother un-wildcarding non-IPv4 packets. Signed-off-by: Justin Pettit Acked-by: Ethan Jackson --- diff --git a/ofproto/netflow.c b/ofproto/netflow.c index c7eb2b516..19ca80fc4 100644 --- a/ofproto/netflow.c +++ b/ofproto/netflow.c @@ -52,8 +52,11 @@ struct netflow { }; void -netflow_mask_wc(struct flow_wildcards *wc) +netflow_mask_wc(struct flow *flow, struct flow_wildcards *wc) { + if (flow->dl_type != htons(ETH_TYPE_IP)) { + return; + } memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto); memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src); memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst); diff --git a/ofproto/netflow.h b/ofproto/netflow.h index 7e6debcd2..e2366f69f 100644 --- a/ofproto/netflow.h +++ b/ofproto/netflow.h @@ -62,7 +62,7 @@ void netflow_expire(struct netflow *, struct netflow_flow *, bool netflow_run(struct netflow *); void netflow_wait(struct netflow *); -void netflow_mask_wc(struct flow_wildcards *); +void netflow_mask_wc(struct flow *, struct flow_wildcards *); void netflow_flow_init(struct netflow_flow *); void netflow_flow_clear(struct netflow_flow *); diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 4ed3cdcfd..78617a292 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -1902,7 +1902,7 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) memset(&wc->masks.tunnel, 0xff, sizeof wc->masks.tunnel); } if (xin->ofproto->netflow) { - netflow_mask_wc(wc); + netflow_mask_wc(flow, wc); } ctx.xout->tags = 0;