lldpd (0.7.14)
* Features:
+ Shutdown LLPDU are sent on MSAP change and when lldpd exits.
+ + When an exact IP is provided as a management pattern, use it
+ unconditionally.
* Fix:
+ Incorrect boundary check when decoding management address and
protocol identity may lead to lldpd crash when processing
.Bd -ragged -offset XXXXXX
Specify the management addresses of this system. As for interfaces
(described above), this option can use wildcards and inversions.
-Without this option, the first IPv4 and the first IPv6 are used. If
-only negative patterns are provided, only one IPv4 and one IPv6
-addresses are chosen. Otherwise, many of them can be selected. If you
-want to blacklist IPv6 addresses, you can use
+Without this option, the first IPv4 and the first IPv6 are used. If an
+exact IP address is provided, it is used as a management address
+without any check. If only negative patterns are provided, only one
+IPv4 and one IPv6 addresses are chosen. Otherwise, many of them can be
+selected. If you want to blacklist IPv6 addresses, you can use
.Em !*:* .
.Ed
{
int allnegative = 0;
int af;
+ const char *pattern = cfg->g_config.c_mgmt_pattern;
lldpd_chassis_mgmt_cleanup(LOCAL_CHASSIS(cfg));
+ /* Is the pattern provided an actual IP address? */
+ if (pattern && strpbrk(pattern, "!,*?") == NULL) {
+ struct in6_addr addr;
+ size_t addr_size;
+ for (af = LLDPD_AF_UNSPEC + 1;
+ af != LLDPD_AF_LAST; af++) {
+ switch (af) {
+ case LLDPD_AF_IPV4: addr_size = sizeof(struct in_addr); break;
+ case LLDPD_AF_IPV6: addr_size = sizeof(struct in6_addr); break;
+ default: assert(0);
+ }
+ if (inet_pton(lldpd_af(af), pattern, &addr) == 1)
+ break;
+ }
+ if (af == LLDPD_AF_LAST) {
+ log_debug("interfaces",
+ "interface management pattern is an incorrect IP");
+ } else {
+ struct lldpd_mgmt *mgmt;
+ mgmt = lldpd_alloc_mgmt(af, &addr, addr_size, 0);
+ if (mgmt == NULL) {
+ log_warn("interfaces", "out of memory error");
+ return;
+ }
+ log_debug("interfaces", "add exact management address %s",
+ pattern);
+ TAILQ_INSERT_TAIL(&LOCAL_CHASSIS(cfg)->c_mgmt, mgmt, m_entries);
+ }
+ return;
+ }
+
/* Is the pattern provided all negative? */
- if (cfg->g_config.c_mgmt_pattern == NULL) allnegative = 1;
- else if (cfg->g_config.c_mgmt_pattern[0] == '!') {
+ if (pattern == NULL) allnegative = 1;
+ else if (pattern[0] == '!') {
/* If each comma is followed by '!', its an all
negative pattern */
- char *sep = cfg->g_config.c_mgmt_pattern;
+ const char *sep = pattern;
while ((sep = strchr(sep, ',')) &&
(*(++sep) == '!'));
if (sep == NULL) allnegative = 1;
.It Fl m Ar management
Specify the management addresses of this system. As for interfaces
(described below), this option can use wildcards and inversions.
-Without this option, the first IPv4 and the first IPv6 are used. If
-only negative patterns are provided, only one IPv4 and one IPv6
-addresses are chosen. Otherwise, many of them can be selected. If you
-want to blacklist IPv6 addresses, you can use
+Without this option, the first IPv4 and the first IPv6 are used. If an
+exact IP address is provided, it is used as a management address
+without any check. If only negative patterns are provided, only one
+IPv4 and one IPv6 addresses are chosen. Otherwise, many of them can be
+selected. If you want to blacklist IPv6 addresses, you can use
.Em !*:* .
.It Fl u Ar file
Specify the Unix-domain socket used for communication with