From 3baa28f24b3d70a7ee17d584c113a2c4e057a565 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 13 Apr 2018 14:36:32 +0200 Subject: src: rename ibrportname, obrportname For bridge, iifname is the port name, whereas 'ibrport' is the logical name of the bridge ("br0") the port ("iifname") is enslaved to. So, 'ibrport' is a misnomer. libnftl calls these 'bri_iifname' and 'bri_oifname', which is good but using 'briiifname' in nft is rather ugly, so use 'ibridgename' and 'obridgename' instead. Old names are still recognized, listing shows the new names. Signed-off-by: Florian Westphal --- src/meta.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/meta.c') diff --git a/src/meta.c b/src/meta.c index 11de2dab..f8010964 100644 --- a/src/meta.c +++ b/src/meta.c @@ -413,10 +413,10 @@ static const struct meta_template meta_templates[] = { 1 , BYTEORDER_HOST_ENDIAN), [NFT_META_RTCLASSID] = META_TEMPLATE("rtclassid", &realm_type, 4 * 8, BYTEORDER_HOST_ENDIAN), - [NFT_META_BRI_IIFNAME] = META_TEMPLATE("ibriport", &ifname_type, + [NFT_META_BRI_IIFNAME] = META_TEMPLATE("ibridgename", &ifname_type, IFNAMSIZ * BITS_PER_BYTE, BYTEORDER_HOST_ENDIAN), - [NFT_META_BRI_OIFNAME] = META_TEMPLATE("obriport", &ifname_type, + [NFT_META_BRI_OIFNAME] = META_TEMPLATE("obridgename", &ifname_type, IFNAMSIZ * BITS_PER_BYTE, BYTEORDER_HOST_ENDIAN), [NFT_META_PKTTYPE] = META_TEMPLATE("pkttype", &pkttype_type, @@ -451,6 +451,8 @@ static bool meta_key_is_qualified(enum nft_meta_keys key) case NFT_META_PRIORITY: case NFT_META_PRANDOM: case NFT_META_SECPATH: + case NFT_META_BRI_IIFNAME: + case NFT_META_BRI_OIFNAME: return true; default: return false; @@ -652,6 +654,15 @@ struct error_record *meta_key_parse(const struct location *loc, return NULL; } + /* Backwards compat hack */ + if (strcmp(str, "ibriport") == 0) { + *value = NFT_META_BRI_IIFNAME; + return NULL; + } else if (strcmp(str, "obriport") == 0) { + *value = NFT_META_BRI_OIFNAME; + return NULL; + } + len = (int)sizeof(buf); size = sizeof(buf); -- cgit v1.2.3