]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpmed: fix numeric values for L2 priority
authorVincent Bernat <vincent@bernat.im>
Tue, 1 Dec 2015 07:15:04 +0000 (08:15 +0100)
committerVincent Bernat <vincent@bernat.im>
Tue, 1 Dec 2015 07:15:04 +0000 (08:15 +0100)
"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.

NEWS
src/client/lldpcli.8.in
src/lib/atoms/med.c

diff --git a/NEWS b/NEWS
index f0fb9d30d156f0a2c5c398c010e90d712b193dc9..973e49e84f6f39686557d4beb8b0c28f4fb7cd19 100644 (file)
--- 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
index 49bcceabf6f52ed1f7a971c8e2264d432f8a76d7..cd5807caf04a85444037d2f5b639304fe45443dc 100644 (file)
@@ -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
index 6c425c643bdcb3384768227c769ae37739bcff90..34fb18d0de83d24024a6210a58cd311596b90122 100644 (file)
@@ -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" },