mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
dpif-netdev: Unwildcard entire odp_port in dpif_netdev_mask_from_nlattrs().
One case in the dpif_netdev_mask_from_nlattrs() function accidentally wildcarded only a 16-bit subset of the mask's odp_port. On little-endian machines this subset was the lower bits, which happened to work out OK, but on big-endian machines this subset was the upper bits, which doesn't work and causes a test failure. (The problem was actually visible in the test expected results on little-endian machines, but we had not noticed.) This commit unwildcards the whole field, fixing the problem, and updates the test expected results to match. This fixes the failure of test 732 seen here: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=sparc&ver=2.1.0%2Bgit20140325-1&stamp=1396438624 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
@@ -1136,8 +1136,6 @@ dpif_netdev_mask_from_nlattrs(const struct nlattr *key, uint32_t key_len,
|
||||
|
||||
return EINVAL;
|
||||
}
|
||||
/* Force unwildcard the in_port. */
|
||||
mask->in_port.odp_port = u32_to_odp(UINT32_MAX);
|
||||
} else {
|
||||
enum mf_field_id id;
|
||||
/* No mask key, unwildcard everything except fields whose
|
||||
@@ -1156,6 +1154,14 @@ dpif_netdev_mask_from_nlattrs(const struct nlattr *key, uint32_t key_len,
|
||||
}
|
||||
}
|
||||
|
||||
/* Force unwildcard the in_port.
|
||||
*
|
||||
* We need to do this even in the case where we unwildcard "everything"
|
||||
* above because "everything" only includes the 16-bit OpenFlow port number
|
||||
* mask->in_port.ofp_port, which only covers half of the 32-bit datapath
|
||||
* port number mask->in_port.odp_port. */
|
||||
mask->in_port.odp_port = u32_to_odp(UINT32_MAX);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user