X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=ofproto%2Fnetflow.c;h=9d9ef19809a7919f661f2dfe34a32726c5ffd79a;hb=765899376740486ca111c62a851b6120864f5698;hp=c237ef25f4f63ac79b3648cf290b0898368ec86d;hpb=007948177581f3b3dad188221593d0e4bdca6ba0;p=openvswitch diff --git a/ofproto/netflow.c b/ofproto/netflow.c index c237ef25..9d9ef198 100644 --- a/ofproto/netflow.c +++ b/ofproto/netflow.c @@ -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.tos_frag & IP_DSCP_MASK; /* NetFlow messages are limited to 30 records. */ if (ntohs(nf_hdr->count) >= 30) {