From ab83c8c571df1fde72f7b75375ecc389d9e82c3e Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Mon, 29 Feb 2016 11:13:28 -0800 Subject: [PATCH] odp-util: Use FLOW_MAX_MPLS_LABELS when parsing MPLS ODP keys. Even though the number of supported MPLS labels may vary between a datapath and the OVS userspace, it is better to use the FLOW_MAX_MPLS_LABELS than a hard-coded '3' as the maximum number of labels to scan. Requested-by: Ben Pfaff Signed-off-by: Jarno Rajahalme Acked-by: Ben Pfaff --- lib/odp-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index 51dafe002..b5e782675 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -4052,7 +4052,7 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names, SCAN_SINGLE("eth_type(", ovs_be16, be16, OVS_KEY_ATTR_ETHERTYPE); - SCAN_BEGIN_ARRAY("mpls(", struct ovs_key_mpls, 3) { + SCAN_BEGIN_ARRAY("mpls(", struct ovs_key_mpls, FLOW_MAX_MPLS_LABELS) { SCAN_FIELD_ARRAY("label=", mpls_label, mpls_lse); SCAN_FIELD_ARRAY("tc=", mpls_tc, mpls_lse); SCAN_FIELD_ARRAY("ttl=", mpls_ttl, mpls_lse); -- 2.20.1