From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Feb 18 06:30:02 2010 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 84589106566C for ; Thu, 18 Feb 2010 06:30:02 +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 487168FC13 for ; Thu, 18 Feb 2010 06:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o1I6U1Yh054812 for ; Thu, 18 Feb 2010 06:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o1I6U1bB054810; Thu, 18 Feb 2010 06:30:01 GMT (envelope-from gnats) Resent-Date: Thu, 18 Feb 2010 06:30:01 GMT Resent-Message-Id: <201002180630.o1I6U1bB054810@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, Alexander Zagrebin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CA06106566B for ; Thu, 18 Feb 2010 06:21:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E7EB18FC18 for ; Thu, 18 Feb 2010 06:21:37 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o1I6Lbci025061 for ; Thu, 18 Feb 2010 06:21:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o1I6Lb5N025060; Thu, 18 Feb 2010 06:21:37 GMT (envelope-from nobody) Message-Id: <201002180621.o1I6Lb5N025060@www.freebsd.org> Date: Thu, 18 Feb 2010 06:21:37 GMT From: Alexander Zagrebin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/144054: opnbgpd doesn't announce a host routes X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 06:30:02 -0000 >Number: 144054 >Category: ports >Synopsis: opnbgpd doesn't announce a host routes >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 18 06:30:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Alexander Zagrebin >Release: 7.1-RELEASE >Organization: >Environment: FreeBSD xxx.visp.ru 7.1-RELEASE-p4 FreeBSD 7.1-RELEASE-p4 #0: Fri Dec 25 23:06:40 MSK 2009 root@xxx.visp.ru:/usr/src/sys/amd64/compile/KERNEL amd64 >Description: I have noticed that openbgpd (including the latest openbgpd-4.6.20100215) doesn't announce a host routes. The reason is in fact that openbgpd doesn't interpret a host routes as "connected". >How-To-Repeat: Create point-to-point link: # ifconfig tun0 create inet 1.2.3.4 5.6.7.8 or add host route # route add 6.7.8.9 some_gateway # netstat -rn Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire .. 5.6.7.8 1.2.3.4 UH 0 0 tun0 6.7.8.9 x.y.z.t UGHS 0 0 vlan20 .. Now use `bgpctl show rib`, `bgpctl show ip bgp out nei gw` etc to see that openbgpd doesn't "see" and doesn't announce a host routes >Fix: The attached patch solves the problem. Patch attached with submission follows: --- bgpd/kroute.c.orig 2009-12-26 09:03:41.000000000 +0300 +++ bgpd/kroute.c 2009-12-26 09:27:42.000000000 +0300 @@ -2255,8 +2255,10 @@ break; kr->r.prefixlen = mask2prefixlen(sa_in->sin_addr.s_addr); - } else if (rtm->rtm_flags & RTF_HOST) + } else if (rtm->rtm_flags & RTF_HOST) { kr->r.prefixlen = 32; + kr->r.flags |= F_CONNECTED; + } else kr->r.prefixlen = prefixlen_classful(kr->r.prefix.s_addr); @@ -2293,8 +2295,10 @@ if (sa_in6->sin6_len == 0) break; kr6->r.prefixlen = mask2prefixlen6(sa_in6); - } else if (rtm->rtm_flags & RTF_HOST) + } else if (rtm->rtm_flags & RTF_HOST) { kr6->r.prefixlen = 128; + kr->r.flags |= F_CONNECTED; + } else fatalx("INET6 route without netmask"); break; @@ -2560,8 +2564,10 @@ if (sa_in->sin_len != 0) prefixlen = mask2prefixlen( sa_in->sin_addr.s_addr); - } else if (rtm->rtm_flags & RTF_HOST) + } else if (rtm->rtm_flags & RTF_HOST) { prefixlen = 32; + flags |= F_CONNECTED; + } else prefixlen = prefixlen_classful(prefix.v4.s_addr); @@ -2573,8 +2579,10 @@ if (sa_in6 != NULL) { if (sa_in6->sin6_len != 0) prefixlen = mask2prefixlen6(sa_in6); - } else if (rtm->rtm_flags & RTF_HOST) + } else if (rtm->rtm_flags & RTF_HOST) { prefixlen = 128; + kr->r.flags |= F_CONNECTED; + } else fatalx("in6 net addr without netmask"); break; >Release-Note: >Audit-Trail: >Unformatted: