From: Vincent Bernat Date: Tue, 1 Dec 2015 07:15:04 +0000 (+0100) Subject: lldpmed: fix numeric values for L2 priority X-Git-Tag: 0.8.0~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7f83dc0ab534669598155e42452e20d4a8e7a54;p=thirdparty%2Flldpd.git lldpmed: fix numeric values for L2 priority "Best effort" is the default priority and is 0. Other priorities are then ordered from 1 to 7 (from the lowest to the highest). Add a note in the manual page about the fact that the labels are not enforceable and more recent standards may change them and their meaning. --- diff --git a/NEWS b/NEWS index f0fb9d30..973e49e8 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ lldpd (0.8.0) + Fix a buffer overflow when receiving a too large management address TLV. Unless hardening has been disabled, this overflow cannot be used for arbitrary code execution. + + Change the numeric value for LLDP-MED policy L2 priority value + for "Best effort" to 0 to match 802.1D-2004. * Change: + Running lldpd with "-d" will keep the process in foreground but logs will still go to syslog. To log to the console, add at diff --git a/src/client/lldpcli.8.in b/src/client/lldpcli.8.in index 49bcceab..cd5807ca 100644 --- a/src/client/lldpcli.8.in +++ b/src/client/lldpcli.8.in @@ -633,32 +633,35 @@ specified, the network policy for the given application type is defined. .Pp When a VLAN is specified with -.Cd vlan +.Ar vlan tells which 802.1q VLAN ID has to be advertised for the network policy. A valid value is between 1 and 4094. .Cd tagged tells the VLAN should be tagged for the specified application type. -.Cd priority +.Pp +.Ar priority allows one to specify IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also known as Class of Service (CoS), to be used for the specified application type. This field is usually ignored if no VLAN is -specified. It should be one of those values: -.Bl -bullet -compact -offset XXXXXXXX -.It +specified. The names match 802.1D-2004 standard (table G-2). Some more +recent standards may use different labels. Only the numeric values +should be relied upon. The accepted labels are: +.Bl -tag -width "X." -compact -offset XXXX +.It Sy 1 background -.It +.It Sy 2 spare -.It +.It Sy 0 best-effort -.It +.It Sy 3 excellent-effort -.It +.It Sy 4 controlled-load -.It +.It Sy 5 video -.It +.It Sy 6 voice -.It +.It Sy 7 network-control .El .Pp diff --git a/src/lib/atoms/med.c b/src/lib/atoms/med.c index 6c425c64..34fb18d0 100644 --- a/src/lib/atoms/med.c +++ b/src/lib/atoms/med.c @@ -117,9 +117,9 @@ static struct atom_map port_med_policy_map = { static struct atom_map port_med_policy_prio_map = { .key = lldpctl_k_med_policy_priority, .map = { - { 0, "Background" }, - { 1, "Spare" }, - { 2, "Best effort" }, + { 1, "Background" }, + { 2, "Spare" }, + { 0, "Best effort" }, { 3, "Excellent effort" }, { 4, "Controlled load" }, { 5, "Video" },