From nobody@FreeBSD.org  Wed Jan  2 13:31:06 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11D1CA2D
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Jan 2013 13:31:06 +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 D24438FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  2 Jan 2013 13:31:05 +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 r02DV5xe056310
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 2 Jan 2013 13:31:05 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r02DV56H056309;
	Wed, 2 Jan 2013 13:31:05 GMT
	(envelope-from nobody)
Message-Id: <201301021331.r02DV56H056309@red.freebsd.org>
Date: Wed, 2 Jan 2013 13:31:05 GMT
From: Peter Wemm <peter@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Interface routes are broken
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174897
>Category:       kern
>Synopsis:       [route] Interface routes are broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 02 13:40:01 UTC 2013
>Closed-Date:    
>Last-Modified:  Sun Jan 20 01:57:15 UTC 2013
>Originator:     Peter Wemm
>Release:        10-current
>Organization:
FreeBSD
>Environment:
FreeBSD mailspool.freebsd.org 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r244957: Wed Jan  2 11:18:56 UTC 2013
>Description:
Interface creation now fails to correctly install more-specific routes, or gets terribly confused.

This happens in two cases that are critical for freebsd.org cluster infrastructure machines.

1) Discard interface as a supernet is broken..

2) jail loopback substitution aliases are broken.
>How-To-Repeat:
The most urgent problem:

peter@mailspool:# % netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
root@mailspool:/home/peter # ifconfig -a | fgrep 127.0
        inet 127.0.0.1 netmask 0xff000000
root@mailspool:/home/peter # ifconfig lo1 create
root@mailspool:/home/peter # ifconfig -a | fgrep 127.0
        inet 127.0.0.1 netmask 0xff000000
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
root@mailspool:/home/peter # ifconfig lo1 inet 127.0.3.1/32 alias
ifconfig: ioctl (SIOCAIFADDR): File exists
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
127.0.3.1          link#4             UHS         0        0    lo0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note how it created something on the wrong interface.

root@mailspool:/home/peter # ifconfig lo1 | grep 127
root@mailspool:/home/peter # ifconfig lo0 | grep 127
	inet 127.0.0.1 netmask 0xff000000
root@mailspool:/home/peter # ifconfig lo1 inet 127.0.3.1/32 -alias
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
127.0.3.1          link#4             UHS         0        0    lo0

. and deleting the interface address doesn't work either.

root@mailspool:/home/peter # ifconfig lo1 destroy
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
127.0.3.1          link#4             UHS         0        0    lo0
root@mailspool:/home/peter # route delete 127.0.3.1
delete host 127.0.3.1
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0

Trying it with a network instead of a host doesn't work either.

root@mailspool:/home/peter # ifconfig lo1 create
root@mailspool:/home/peter # ifconfig lo1 127.0.1.1/24
ifconfig: ioctl (SIOCAIFADDR): File exists
root@mailspool:/home/peter # netstat -rn | grep 127
127.0.0.1          link#3             UH          0        0    lo0
127.0.1.1          link#4             UHS         0        0    lo0

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jan 20 01:56:52 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174897 
>Unformatted:
