Bug 172880

Summary: lldp (openlldp) triggers failures when the system has carp interfaces.
Product: Base System Reporter: Andre Gustavo N. Lopes <andre>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: emaste
Priority: Normal    
Version: 8.3-STABLE   
Hardware: Any   
OS: Any   

Description Andre Gustavo N. Lopes 2012-10-19 14:00:01 UTC
It looks like the lldp protocol (openlldp) triggers the below error when the system has a carp interface:

..
carp_looutput: af=1 unexpected
carp_looutput: af=1 unexpected
carp_looutput: af=1 unexpected
..

Investigating a little bit I've found this in /usr/src/sys/net/netinet/ip_carp.c:

carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
    struct route *ro)
{
..
#if 1   /* XXX */
        switch (dst->sa_family) {
        case AF_INET:
        case AF_INET6:
        case AF_IPX:
        case AF_APPLETALK:
                break;
        default:
                printf("carp_looutput: af=%d unexpected\n", dst->sa_family);
                m_freem(m);
                return (EAFNOSUPPORT);
        }
..
}

It looks like the switch (dst->sa_family) is returning 1 (dmesg log says: carp_looutput: af=1 unexpected). 

I thought I could just ignore this (and comment the printf out, but after some hours lldp consumes a bunch of swap and eventually dies:

..
swap_pager_getswapspace(2): failed
swap_pager_getswapspace(16): failed
pid 2628 (lldpd), uid 0, was killed: out of swap space

I wonder if ip_carp.c, when checking the address_family was not supposed to  accomodate the lldp packages.

How-To-Repeat: 1- Create a carp interface, no peer required, any ip address
2- Install and install openlldp
3- Follow up dmesg and logs
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:45 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"