From nobody@FreeBSD.org  Thu Jul  2 22:21:17 2009
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 5B19A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  2 Jul 2009 22:21:17 +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 491378FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  2 Jul 2009 22:21:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n62MLHNO068446
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 2 Jul 2009 22:21:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n62MLG9i068445;
	Thu, 2 Jul 2009 22:21:16 GMT
	(envelope-from nobody)
Message-Id: <200907022221.n62MLG9i068445@www.freebsd.org>
Date: Thu, 2 Jul 2009 22:21:16 GMT
From: Andrew <fbsdbugs.10.awinder@spamgourmet.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Able to set an invalid netmask
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         136257
>Category:       bin
>Synopsis:       ifconfig(8): Able to set an invalid netmask
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 02 22:30:04 UTC 2009
>Closed-Date:    Sat Jul 18 21:33:58 UTC 2009
>Last-Modified:  Sat Jul 18 21:33:58 UTC 2009
>Originator:     Andrew
>Release:        7.2-RELEASE-p2
>Organization:
Falcon Tech Systems
>Environment:
>Description:
I'm able to set an invalid netmask:

ifconfig bridge0 inet 192.168.8.1 netmask 0xd0452484;

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 6a:7d:09:1a:3e:34
        inet 192.168.8.1 netmask 0xd0452484 broadcast 192.168.8.255
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000

Netstat output is then confusing:
192.0.0.0&0xd0452484  link#5    UC    0    0 bridge

I've also tested this on a non-bridge interface, gif0, em0. As inet corresponds to an IPv4 address, this seems invalid.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: brian 
State-Changed-When: Fri Jul 3 05:38:27 UTC 2009 
State-Changed-Why:  
Hi, 

Can you be more specific as to why you think there's a problem? 
FreeBSD supports non-contiguous netmasks - they don't have to 
be composed of a series of binary ones followed by all binary 
zeros.  When a netmask is non-contiguous, the system shows it 
as a hex value rather than as a number of one-bits. 

Unless you've got any specific problems with this, I'd like 
to close this as a feature not a bug. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136257 
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Fri Jul 3 05:40:56 UTC 2009 
Responsible-Changed-Why:  
I'll take this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=136257 
State-Changed-From-To: feedback->closed 
State-Changed-By: brian 
State-Changed-When: Sat Jul 18 21:32:33 UTC 2009 
State-Changed-Why:  
No further feedback from the submitter.  Non-contiguous netmasks 
are a feature. 

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