Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2006 17:15:38 GMT
From:      Vladimir Ivanov<wawa@yandex-team.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/106722: ifconfig may not connect an interface to known network
Message-ID:  <200612141715.kBEHFc0k070023@www.freebsd.org>
Resent-Message-ID: <200612141740.kBEHeATG009542@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         106722
>Category:       kern
>Synopsis:       ifconfig may not connect an interface to known network
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 14 17:40:09 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Vladimir Ivanov
>Release:        RELENG_6
>Organization:
Yandex LLC
>Environment:
FreeBSD karoto.yandex.net 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #20: Fri Dec  1 20:29:20 MSK 2006     root@barbedo.yandex.net:/usr/obj/usr/src/sys/CORE-RTR-RELENG_6  i386

>Description:
ifconfig may not connect an interface to known network.
It's a very unpleasant problem if you being use QUAGGA e.g.
>How-To-Repeat:
route add 10.0.0.0/24 some.gateway
ifconfig IFACE 10.0.0.1/24 alias

>Fix:


Patch attached with submission follows:

--- sys/net/route.c.orig	2006-12-01 20:28:22.000000000 +0300
+++ sys/net/route.c	2006-12-01 20:28:22.000000000 +0300
@@ -809,6 +809,12 @@ rtrequest1(int req, struct rt_addrinfo *
 				RT_UNLOCK(rt2);
 				rn = rnh->rnh_addaddr(ndst, netmask,
 						      rnh, rt->rt_nodes);
+                        } else if (!(flags & RTF_GATEWAY) && (rt2 -> rt_flags & RTF_GATEWAY)) {
+                                /* dirty hack allows ifconfig to setup address which is known to RT */
+                                rtexpunge(rt2);
+                                RT_UNLOCK(rt2);
+                                rn = rnh->rnh_addaddr(ndst, netmask,
+                                                      rnh, rt->rt_nodes);
 			} else if (rt2) {
 				/* undo the extra ref we got */
 				RTFREE_LOCKED(rt2);

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612141715.kBEHFc0k070023>