From: Susant Sahani Date: Tue, 7 May 2019 05:01:22 +0000 (+0530) Subject: networkd: VXLAN rename Id to VNI X-Git-Tag: v243-rc1~471^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f213e4a3465f7c9c986fff0b701cc0e00fb636b;p=thirdparty%2Fsystemd.git networkd: VXLAN rename Id to VNI It makes more sense to call VXLAN ID as 1. the VXLAN Network Identifier (VNI) (or VXLAN Segment ID) 2. test-network: rename VXLAN Id to VNI 3. fuzzer: Add VXLAN VNI directive to fuzzer --- diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index 4cb3258c111..3841ad54b72 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -527,9 +527,9 @@ - Id= + VNI= - The VXLAN ID to use. Takes a number in the range 1-16777215. + The VXLAN Network Identifier (or VXLAN Segment ID). Takes a number in the range 1-16777215. diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index 16636601a0f..163d7d01d2a 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -96,7 +96,8 @@ L2TPSession.Name, config_parse_l2tp_session_name, Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer) Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer) VXCAN.Peer, config_parse_ifname, 0, offsetof(VxCan, ifname_peer) -VXLAN.Id, config_parse_uint64, 0, offsetof(VxLan, id) +VXLAN.VNI, config_parse_uint64, 0, offsetof(VxLan, vni) +VXLAN.Id, config_parse_uint64, 0, offsetof(VxLan, vni) /* deprecated */ VXLAN.Group, config_parse_vxlan_address, 0, offsetof(VxLan, remote) VXLAN.Local, config_parse_vxlan_address, 0, offsetof(VxLan, local) VXLAN.Remote, config_parse_vxlan_address, 0, offsetof(VxLan, remote) diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c index 4b855ae1e11..c8d9cd46757 100644 --- a/src/network/netdev/vxlan.c +++ b/src/network/netdev/vxlan.c @@ -27,8 +27,8 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli assert(v); - if (v->id <= VXLAN_VID_MAX) { - r = sd_netlink_message_append_u32(m, IFLA_VXLAN_ID, v->id); + if (v->vni <= VXLAN_VID_MAX) { + r = sd_netlink_message_append_u32(m, IFLA_VXLAN_ID, v->vni); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_ID attribute: %m"); } @@ -273,8 +273,8 @@ static int netdev_vxlan_verify(NetDev *netdev, const char *filename) { assert(v); assert(filename); - if (v->id > VXLAN_VID_MAX) { - log_warning("VXLAN without valid Id configured in %s. Ignoring", filename); + if (v->vni > VXLAN_VID_MAX) { + log_warning("VXLAN without valid VNI (or VXLAN Segment ID) configured in %s. Ignoring", filename); return -EINVAL; } @@ -290,7 +290,7 @@ static void vxlan_init(NetDev *netdev) { assert(v); - v->id = VXLAN_VID_MAX + 1; + v->vni = VXLAN_VID_MAX + 1; v->learning = true; v->udpcsum = false; v->udp6zerocsumtx = false; diff --git a/src/network/netdev/vxlan.h b/src/network/netdev/vxlan.h index 3b273e97bdb..99d16c1ab91 100644 --- a/src/network/netdev/vxlan.h +++ b/src/network/netdev/vxlan.h @@ -12,7 +12,7 @@ typedef struct VxLan VxLan; struct VxLan { NetDev meta; - uint64_t id; + uint64_t vni; int remote_family; int local_family; diff --git a/test/fuzz/fuzz-netdev-parser/directives.netdev b/test/fuzz/fuzz-netdev-parser/directives.netdev index ab7d9f6fc96..0d0bd2c85b2 100644 --- a/test/fuzz/fuzz-netdev-parser/directives.netdev +++ b/test/fuzz/fuzz-netdev-parser/directives.netdev @@ -93,6 +93,7 @@ Group= FDBAgeingSec= MacLearning= Id= +VNI= RemoteChecksumRx= TOS= L2MissNotification= diff --git a/test/test-network/conf/25-vxlan.netdev b/test/test-network/conf/25-vxlan.netdev index 819a58356fa..d5acf48da5b 100644 --- a/test/test-network/conf/25-vxlan.netdev +++ b/test/test-network/conf/25-vxlan.netdev @@ -3,7 +3,7 @@ Name=vxlan99 Kind=vxlan [VXLAN] -Id=999 +VNI=999 L2MissNotification=true L3MissNotification=true RouteShortCircuit=true