]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
bsd: check of SIOCGIFDESCR instead of IFDESCRSIZE
authorVincent Bernat <vbe@deezer.com>
Wed, 2 Apr 2014 13:55:55 +0000 (15:55 +0200)
committerVincent Bernat <vbe@deezer.com>
Wed, 2 Apr 2014 13:55:55 +0000 (15:55 +0200)
IFDESCRSIZE is defined at the beginning of the file and is therefore
always defined. Just check if SIOCGIFDESCR exists instead.

src/daemon/interfaces-bsd.c

index 74751503183db50a616f2daca48f1fb60934e447..fda887c2c0b0edaaadb2ed2169259aa0d8b09646 100644 (file)
@@ -359,7 +359,7 @@ ifbsd_extract_device(struct lldpd *cfg,
                memcpy(iface->address, LLADDR(saddrdl), ETHER_ADDR_LEN);
 
        /* Grab description */
-#ifdef IFDESCRSIZE
+#ifdef SIOCGIFDESCR
 #if defined HOST_OS_FREEBSD || defined HOST_OS_OPENBSD
        iface->alias = malloc(IFDESCRSIZE);
        if (iface->alias) {
@@ -380,7 +380,7 @@ ifbsd_extract_device(struct lldpd *cfg,
                }
        }
 #endif
-#endif /* IFDESCRSIZE */
+#endif /* SIOCGIFDESCR */
 
        if (ifbsd_check_wireless(cfg, ifaddr, iface) == -1) {
                interfaces_free_device(iface);