Remove forward declaration of vsp_vlandev_to_realdev()
[openvswitch] / lib / meta-flow.c
index 69226cbcfb794c8e16f825986e89ee5d7b1e5f65..8b60b35f11ee0368b5b7b129ab618f0cdff508b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012 Nicira Networks.
+ * Copyright (c) 2011, 2012 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1344,7 +1344,7 @@ mf_set_flow_value(const struct mf_field *mf,
         break;
 
     case MFF_ETH_DST:
-        memcpy(flow->dl_src, value->mac, ETH_ADDR_LEN);
+        memcpy(flow->dl_dst, value->mac, ETH_ADDR_LEN);
         break;
 
     case MFF_ETH_TYPE:
@@ -1457,6 +1457,19 @@ mf_set_flow_value(const struct mf_field *mf,
     }
 }
 
+/* Returns true if 'mf' has a zero value in 'flow', false if it is nonzero.
+ *
+ * The caller is responsible for ensuring that 'flow' meets 'mf''s
+ * prerequisites. */
+bool
+mf_is_zero(const struct mf_field *mf, const struct flow *flow)
+{
+    union mf_value value;
+
+    mf_get_value(mf, flow, &value);
+    return is_all_zeros((const uint8_t *) &value, mf->n_bytes);
+}
+
 /* Makes 'rule' wildcard field 'mf'.
  *
  * The caller is responsible for ensuring that 'rule' meets 'mf''s