ofproto-dpif: Remove duplicate VLAN logic.
[sliver-openvswitch.git] / ofproto / netflow.c
index c237ef2..bf2e628 100644 (file)
@@ -104,7 +104,7 @@ struct netflow {
 
 static void
 gen_netflow_rec(struct netflow *nf, struct netflow_flow *nf_flow,
-                struct ofexpired *expired, 
+                struct ofexpired *expired,
                 uint32_t packet_count, uint32_t byte_count)
 {
     struct netflow_v5_header *nf_hdr;
@@ -133,7 +133,7 @@ gen_netflow_rec(struct netflow *nf, struct netflow_flow *nf_flow,
     nf_rec = ofpbuf_put_zeros(&nf->packet, sizeof *nf_rec);
     nf_rec->src_addr = expired->flow.nw_src;
     nf_rec->dst_addr = expired->flow.nw_dst;
-    nf_rec->nexthop = htons(0);
+    nf_rec->nexthop = htonl(0);
     if (nf->add_id_to_iface) {
         uint16_t iface = (nf->engine_id & 0x7f) << 9;
         nf_rec->input = htons(iface | (expired->flow.in_port & 0x1ff));
@@ -160,7 +160,7 @@ gen_netflow_rec(struct netflow *nf, struct netflow_flow *nf_flow,
     }
     nf_rec->tcp_flags = nf_flow->tcp_flags;
     nf_rec->ip_proto = expired->flow.nw_proto;
-    nf_rec->ip_tos = expired->flow.nw_tos;
+    nf_rec->ip_tos = expired->flow.nw_tos & IP_DSCP_MASK;
 
     /* NetFlow messages are limited to 30 records. */
     if (ntohs(nf_hdr->count) >= 30) {