From f98dd1e70750f09a85d9236ad3621b249ad59629 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 31 Aug 2017 01:11:16 +0200 Subject: [PATCH 1/4] networkd: Add `VRF.Table` to support parsing of table names Previously there was only `VRF.TableId` which only supported numeric identifiers for routing table. With the additiona of `config_parse_route_table` also names can be used as identifiers. --- src/network/netdev/netdev-gperf.gperf | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 8b235a4857..2a9bf2b1e3 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -134,3 +134,4 @@ Bridge.MulticastSnooping, config_parse_tristate, 0, Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering) Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp) VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table_id) +VRF.Table, config_parse_route_table, 0, offsetof(Vrf, table_id) From 62b83cf66453649825da69a2c2c571d2b5471fec Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 31 Aug 2017 01:14:05 +0200 Subject: [PATCH 2/4] networkd: Renamed `table_id` field to `table` Other parts of the code do just use `table` as identifier for the actual routing table id. This change should make it easier to read through the code since the meaning or rather the name stays the same. --- src/network/netdev/netdev-gperf.gperf | 4 ++-- src/network/netdev/vrf.c | 2 +- src/network/netdev/vrf.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 2a9bf2b1e3..98182d5f3a 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -133,5 +133,5 @@ Bridge.MulticastQuerier, config_parse_tristate, 0, Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping) Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering) Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp) -VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table_id) -VRF.Table, config_parse_route_table, 0, offsetof(Vrf, table_id) +VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) +VRF.Table, config_parse_route_table, 0, offsetof(Vrf, table) diff --git a/src/network/netdev/vrf.c b/src/network/netdev/vrf.c index f48b413102..a3b271ca23 100644 --- a/src/network/netdev/vrf.c +++ b/src/network/netdev/vrf.c @@ -35,7 +35,7 @@ static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink assert(v); - r = sd_netlink_message_append_u32(m, IFLA_VRF_TABLE, v->table_id); + r = sd_netlink_message_append_u32(m, IFLA_VRF_TABLE, v->table); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IPLA_VRF_TABLE attribute: %m"); diff --git a/src/network/netdev/vrf.h b/src/network/netdev/vrf.h index 00f54ed96d..06f3c17bc1 100644 --- a/src/network/netdev/vrf.h +++ b/src/network/netdev/vrf.h @@ -26,7 +26,7 @@ typedef struct Vrf Vrf; struct Vrf { NetDev meta; - uint32_t table_id; + uint32_t table; }; DEFINE_NETDEV_CAST(VRF, Vrf); From 362f6336df281255306454a1ad7f37276e297332 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 31 Aug 2017 01:44:29 +0200 Subject: [PATCH 3/4] networkd: Updated documentation to refer to new `Table=` parameter --- man/systemd.netdev.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 7290172081..1040562202 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -1314,7 +1314,7 @@ Name=vrf-test Kind=vrf [VRF] -TableId=42 +Table=42 From b13049c76579b3303a4a22e9eba05531f450d07a Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Thu, 31 Aug 2017 12:08:33 +0200 Subject: [PATCH 4/4] networkd: Added deprecation warning to `VRF.TableId` --- src/network/netdev/netdev-gperf.gperf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 98182d5f3a..ab28caf05d 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -133,5 +133,5 @@ Bridge.MulticastQuerier, config_parse_tristate, 0, Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping) Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering) Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp) -VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) +VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) /* deprecated */ VRF.Table, config_parse_route_table, 0, offsetof(Vrf, table)