This makes this TLV optional to send (as authorized in 802.1AB). The
user just has to provide an empty TLV, with, for example `-S ""`.
POKE_END_LLDP_TLV))
goto toobig;
- /* System description */
- if (!(
- POKE_START_LLDP_TLV(LLDP_TLV_SYSTEM_DESCR) &&
- POKE_BYTES(chassis->c_descr, strlen(chassis->c_descr)) &&
- POKE_END_LLDP_TLV))
- goto toobig;
+ /* System description (skip it if empty) */
+ if (chassis->c_descr && *chassis->c_descr != '\0') {
+ if (!(
+ POKE_START_LLDP_TLV(LLDP_TLV_SYSTEM_DESCR) &&
+ POKE_BYTES(chassis->c_descr, strlen(chassis->c_descr)) &&
+ POKE_END_LLDP_TLV))
+ goto toobig;
+ }
/* System capabilities */
if (!(