From nobody@FreeBSD.org  Fri Oct 19 12:59:12 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 10E0BA53
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2012 12:59:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id ED0E08FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2012 12:59:11 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9JCxBlf002328
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 19 Oct 2012 12:59:11 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9JCxBho002327;
	Fri, 19 Oct 2012 12:59:11 GMT
	(envelope-from nobody)
Message-Id: <201210191259.q9JCxBho002327@red.freebsd.org>
Date: Fri, 19 Oct 2012 12:59:11 GMT
From: "Andre Gustavo N. Lopes" <andre@mrx.com.br>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lldp (openlldp) triggers failures when the system has carp interfaces.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172880
>Category:       kern
>Synopsis:       lldp (openlldp) triggers failures when the system has carp interfaces.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 19 13:00:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andre Gustavo N. Lopes
>Release:        8.3-STABLE
>Organization:
MRX
>Environment:
FreeBSD rtdistdc02.datacast.net.br 8.3-STABLE FreeBSD 8.3-STABLE #3: Fri Oct 19 09:31:59 BRT 2012     root@rtdistdc02.datacast.net.br:/usr/obj/usr/src/sys/DELLR410-v2  amd64
>Description:
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
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
