diff options
author | Florian Westphal <fw@strlen.de> | 2018-04-13 14:36:32 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-04-17 23:23:06 +0200 |
commit | 3baa28f24b3d70a7ee17d584c113a2c4e057a565 (patch) | |
tree | c42914610e573bb441505820a1e6ff9eb10f5288 /src/meta.c | |
parent | ce2cc622cb110952323cd310046505653e406193 (diff) |
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 <fw@strlen.de>
Diffstat (limited to 'src/meta.c')
-rw-r--r-- | src/meta.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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); |