X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=ofproto%2Fnetflow.c;h=2e32f219cb5c10848dba79b9333e656381a562b3;hb=f9c0c3eccdb8e14dc8fbf572e515dbef1eb7b2ee;hp=7efb0267833f955d18665f310d2da6f7c9170b64;hpb=1dd35f8afe13fe2e9144052b2d61086e5be6e448;p=sliver-openvswitch.git diff --git a/ofproto/netflow.c b/ofproto/netflow.c index 7efb02678..2e32f219c 100644 --- a/ofproto/netflow.c +++ b/ofproto/netflow.c @@ -97,11 +97,13 @@ gen_netflow_rec(struct netflow *nf, struct netflow_flow *nf_flow, 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)); - nf_rec->output = htons(iface | (nf_flow->output_iface & 0x1ff)); + nf_rec->input = htons(iface + | (ofp_to_u16(expired->flow.in_port.ofp_port) & 0x1ff)); + nf_rec->output = htons(iface + | (ofp_to_u16(nf_flow->output_iface) & 0x1ff)); } else { - nf_rec->input = htons(expired->flow.in_port); - nf_rec->output = htons(nf_flow->output_iface); + nf_rec->input = htons(ofp_to_u16(expired->flow.in_port.ofp_port)); + nf_rec->output = htons(ofp_to_u16(nf_flow->output_iface)); } nf_rec->packet_count = htonl(packet_count); nf_rec->byte_count = htonl(byte_count); @@ -275,7 +277,7 @@ netflow_flow_init(struct netflow_flow *nf_flow OVS_UNUSED) void netflow_flow_clear(struct netflow_flow *nf_flow) { - uint16_t output_iface = nf_flow->output_iface; + ofp_port_t output_iface = nf_flow->output_iface; memset(nf_flow, 0, sizeof *nf_flow); nf_flow->output_iface = output_iface;