netflow: Only un-wildcard IPv4 packets.
authorJustin Pettit <jpettit@nicira.com>
Thu, 27 Jun 2013 00:13:33 +0000 (17:13 -0700)
committerJustin Pettit <jpettit@nicira.com>
Fri, 28 Jun 2013 02:51:51 +0000 (19:51 -0700)
NetFlow v5 only supports IPv4, so don't bother un-wildcarding
non-IPv4 packets.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/netflow.c
ofproto/netflow.h
ofproto/ofproto-dpif.c

index 8cedd13..4347232 100644 (file)
@@ -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);
index 9691545..f4a59a7 100644 (file)
@@ -64,7 +64,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 *);
index af689e8..3cdb884 100644 (file)
@@ -7121,7 +7121,7 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
 
     /* Disable most wildcarding for NetFlow. */
     if (xin->ofproto->netflow) {
-        netflow_mask_wc(wc);
+        netflow_mask_wc(&ctx.xin->flow, wc);
     }
 
     ctx.xout->tags = 0;