From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jul 6 22:10:08 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DD9106564A for ; Wed, 6 Jul 2011 22:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 199658FC1C for ; Wed, 6 Jul 2011 22:10:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p66MA7w6074067 for ; Wed, 6 Jul 2011 22:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p66MA7C4074066; Wed, 6 Jul 2011 22:10:07 GMT (envelope-from gnats) Resent-Date: Wed, 6 Jul 2011 22:10:07 GMT Resent-Message-Id: <201107062210.p66MA7C4074066@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Geoffrey Sisson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 962B0106564A for ; Wed, 6 Jul 2011 22:01:53 +0000 (UTC) (envelope-from geoff@dns-oarc.net) Received: from mail.dns-oarc.net (in1.dns-oarc.net [149.20.58.5]) by mx1.freebsd.org (Postfix) with ESMTP id 89EC58FC1E for ; Wed, 6 Jul 2011 22:01:53 +0000 (UTC) Received: by mail.dns-oarc.net (Postfix, from userid 10801) id BA6D2BDF48; Wed, 6 Jul 2011 21:44:04 +0000 (UTC) Message-Id: <20110706214404.BA6D2BDF48@mail.dns-oarc.net> Date: Wed, 6 Jul 2011 21:44:04 +0000 (UTC) From: Geoffrey Sisson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/158697: radvd doesn't listen for Router Solicitations X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Geoffrey Sisson List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 22:10:08 -0000 >Number: 158697 >Category: ports >Synopsis: radvd doesn't listen for Router Solicitations >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 06 22:10:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Geoffrey Sisson >Release: radvd-1.8 (net/radvd) >Organization: DNS-OARC (http://www.dns-oarc.net/) >Environment: System: FreeBSD dns-tender.dns-oarc.net 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Wed May 11 00:24:33 UTC 2011 root@dns-tender.dns-oarc.net:/usr/obj/usr/src/sys/DNS-TENDER amd64 Version: radvd-1.8 >Description: radvd doesn't listen for Router Solicitations even when "AdvSendAdvert" is set to "on". The function setup_allrouters_membership in device-bsd44.c is just a stub that effectively performs a NOP when establishing a listen socket. The same function in device-linux.c contains a setsockopt call that causes radvd to join the all-routers multicast group. While ignoring RS messages isn't fatal (unconfigured hosts will eventually see an RA message), it is contrary to RFC 2461: A router MUST join the all-routers multicast address on an advertising interface. [Section 6.2.2] >How-To-Repeat: Send Router Solicitations from a host to a FreeBSD router running radvd. tcpdump -i dst host \( ff02::1 or ff02::2 \) will show unanswered Router Solicitations. >Fix: Patch attached. Note that this patch is only partial. The function check_allrouters_membership in device-bsd44.c also needs attention. ------------------------ Begin included text ------------------------ --- radvd-1.8/device-bsd44.c.orig 2011-07-06 20:19:40.000000000 +0000 +++ radvd-1.8/device-bsd44.c 2011-07-06 20:30:37.000000000 +0000 @@ -189,6 +189,24 @@ int setup_allrouters_membership(struct Interface *iface) { + struct ipv6_mreq mreq; + + memset(&mreq, 0, sizeof(mreq)); + mreq.ipv6mr_interface = iface->if_index; + + /* all-routers multicast address */ + if (inet_pton(AF_INET6, "ff02::2", + &mreq.ipv6mr_multiaddr.s6_addr) != 1) { + flog(LOG_ERR, "inet_pton failed"); + return (-1); + } + + if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, + &mreq, sizeof(mreq)) < 0) { + flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->Name); + return (-1); + } + return (0); } ------------------------- End included text ------------------------- >Release-Note: >Audit-Trail: >Unformatted: