From 149fd3fbd069a5f7be86e68472578ee7af229cb6 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Fri, 2 Oct 2020 14:12:37 +0000 Subject: lldp: set interface MAC address when enabled Type: improvement Change-Id: I4f2dc4e4c1c467fb9acd0fed231c56fcd54c8da9 Signed-off-by: Klement Sekera --- src/plugins/lldp/lldp_output.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/plugins/lldp/lldp_output.c') diff --git a/src/plugins/lldp/lldp_output.c b/src/plugins/lldp/lldp_output.c index dc03faf4d5c..deff723b4b3 100644 --- a/src/plugins/lldp/lldp_output.c +++ b/src/plugins/lldp/lldp_output.c @@ -263,6 +263,11 @@ lldp_delete_intf (lldp_main_t * lm, lldp_intf_t * n) } } + +/* 01:80:C2:00:00:0E - propagation constrained to a single + * physical link - stopped by all type of bridge */ +const u8 lldp_mac_addr[6] = { 0x01, 0x80, 0xC3, 0x00, 0x00, 0x0E }; + static clib_error_t * lldp_template_init (vlib_main_t * vm) { @@ -274,16 +279,12 @@ lldp_template_init (vlib_main_t * vm) clib_memset (&h, 0, sizeof (h)); - /* - * Send to 01:80:C2:00:00:0E - propagation constrained to a single - * physical link - stopped by all type of bridge - */ - h.dst_address[0] = 0x01; - h.dst_address[1] = 0x80; - h.dst_address[2] = 0xC2; - /* h.dst_address[3] = 0x00; (clib_memset) */ - /* h.dst_address[4] = 0x00; (clib_memset) */ - h.dst_address[5] = 0x0E; + h.dst_address[0] = lldp_mac_addr[0]; + h.dst_address[1] = lldp_mac_addr[1]; + h.dst_address[2] = lldp_mac_addr[2]; + h.dst_address[3] = lldp_mac_addr[3]; + h.dst_address[4] = lldp_mac_addr[4]; + h.dst_address[5] = lldp_mac_addr[5]; /* leave src address blank (fill in at send time) */ -- cgit 1.2.3-korg