X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fflow.c;h=bfbd54241034ac4dfea39c58144c37c55641035a;hb=7446f1480bb27ccb63feab066d901cc940d52462;hp=c1f6240f01ea0a671f85647aeb3826aa219a7367;hpb=f1acd62b54376a425a975f9af501c4c8c5689b39;p=openvswitch diff --git a/lib/flow.c b/lib/flow.c index c1f6240f..bfbd5424 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -283,13 +283,14 @@ flow_from_match(flow_t *flow, uint32_t *wildcards, { if (wildcards) { *wildcards = ntohl(match->wildcards); - } - /* The datapath supports matching on an ARP's opcode and IP addresses, - * but OpenFlow does not. In case the controller hasn't, we need to - * set the appropriate wildcard bits so that we're externally - * OpenFlow-compliant. */ - if (match->dl_type == htons(ETH_TYPE_ARP)) { - *wildcards |= (OFPFW_NW_PROTO | OFPFW_NW_SRC_ALL | OFPFW_NW_DST_ALL); + + /* The datapath supports matching on an ARP's opcode and IP addresses, + * but OpenFlow does not. In case the controller hasn't, we need to + * set the appropriate wildcard bits so that we're externally + * OpenFlow-compliant. */ + if (match->dl_type == htons(ETH_TYPE_ARP)) { + *wildcards |= OFPFW_NW_PROTO | OFPFW_NW_SRC_ALL | OFPFW_NW_DST_ALL; + } } flow->nw_src = match->nw_src; @@ -317,7 +318,7 @@ flow_to_string(const flow_t *flow) void flow_format(struct ds *ds, const flow_t *flow) { - ds_put_format(ds, "port%04x:vlan%d mac"ETH_ADDR_FMT"->"ETH_ADDR_FMT" " + ds_put_format(ds, "in_port%04x:vlan%d mac"ETH_ADDR_FMT"->"ETH_ADDR_FMT" " "type%04x proto%"PRId8" ip"IP_FMT"->"IP_FMT" port%d->%d", flow->in_port, ntohs(flow->dl_vlan), ETH_ADDR_ARGS(flow->dl_src), ETH_ADDR_ARGS(flow->dl_dst),