NetBSD Problem Report #46234

From ryo_on@yk.rim.or.jp  Wed Mar 21 21:45:56 2012
Return-Path: <ryo_on@yk.rim.or.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 4BA1263DEE5
	for <gnats-bugs@gnats.netbsd.org>; Wed, 21 Mar 2012 21:45:56 +0000 (UTC)
Message-Id: <20120321214556.4BA1263DEE5@www.NetBSD.org>
Date: Wed, 21 Mar 2012 21:45:56 +0000 (UTC)
From: ryoon@NetBSD.org
Reply-To: ryoon@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: brconfig add * does not work
X-Send-Pr-Version: 3.95

>Number:         46234
>Category:       kern
>Synopsis:       brconfig add * does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 21 21:50:00 +0000 2012
>Closed-Date:    Thu Mar 22 12:59:40 +0000 2012
>Last-Modified:  Thu Mar 22 13:00:17 +0000 2012
>Originator:     Ryo ONODERA
>Release:        NetBSD 6.99.4
>Organization:

>Environment:


System: NetBSD hydrogen.elements.tetera.org 6.99.4 NetBSD 6.99.4 (LEAFGIRLB) #2: Thu Mar 22 06:34:10 JST 2012 root@hydrogen.elements.tetera.org:/usr/obj/sys/arch/i386/compile/LEAFGIRLB i386
Architecture: i386
Machine: i386
>Description:
I want to run the following commands for qemu networking.

/sbin/ifconfig tap0 create
/sbin/ifconfig bridge0 create
/sbin/brconfig bridge0 add msk0
/sbin/ifconfig bridge0 up
/sbin/ifconfig tap0 0.0.0.0 up
/sbin/brconfig bridge0 add tap0

But, 
# /sbin/brconfig bridge0 add msk0
fails with the following message.
brconfig: add msk0: Operation not permitted


% ifconfig -a
msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:17:42:3d:72:02
        media: Ethernet autoselect (100baseTX full-duplex,flowcontrol,rxpause,txpause)
        status: active
        inet 192.168.81.210 netmask 0xffffff00 broadcast 192.168.81.255
        inet6 fe80::217:42ff:fe3d:7202%msk0 prefixlen 64 scopeid 0x1
wpi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ssid ""
        powersave off
        address: ff:ff:ff:ff:ff:ff
        media: IEEE802.11 autoselect
        status: no network
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: f2:0b:a4:07:51:0a
        media: Ethernet autoselect
        inet 0.0.0.0 netmask 0xff000000 broadcast 0.255.255.255
        inet6 fe80::f00b:a4ff:fe07:510a%tap0 prefixlen 64 scopeid 0x4
bridge0: flags=41<UP,RUNNING> mtu 1500

% brconfig -a
bridge0: flags=41<UP,RUNNING>
        Configuration:
                priority 32768 hellotime 2 fwddelay 15 maxage 20
                ipfilter disabled flags 0x0
        Interfaces:
        Address cache (max cache: 100, timeout: 1200):



>How-To-Repeat:
run
/sbin/brconfig bridge0 add msk0

>Fix:

I have no idea.


>Release-Note:

>Audit-Trail:
From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46234: brconfig add * does not work
Date: Wed, 21 Mar 2012 23:55:31 -0400

 On Wed, 21 Mar 2012 21:50:00 +0000 (UTC)
 ryoon@NetBSD.org wrote:

 > # /sbin/brconfig bridge0 add msk0
 > fails with the following message.
 > brconfig: add msk0: Operation not permitted

 Perhaps related to a recent kauth related change:

 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/net/if_bridge.c.diff?r1=1.74&r2=1.75&only_with_tag=MAIN
 -- 
 Matt

From: Matthew Mondor <mm_lists@pulsar-zone.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46234: brconfig add * does not work
Date: Thu, 22 Mar 2012 00:02:50 -0400

 On Thu, 22 Mar 2012 04:00:10 +0000 (UTC)
 Matthew Mondor <mm_lists@pulsar-zone.net> wrote:

 >  Perhaps related to a recent kauth related change:
 >  
 >  http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/net/if_bridge.c.diff?r1=1.74&r2=1.75&only_with_tag=MAIN

 +                    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV,

 should be:

 +                    KAUTH_REQ_NETWORK_INTERFACE_BRIDGE_SETPRIV,

 A look at the secmodel code also confirms this.
 -- 
 Matt

From: Geoff Adams <gadams+netbsd@avernus.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46234: brconfig add * does not work
Date: Wed, 21 Mar 2012 21:43:20 -0700

 >  +                    KAUTH_REQ_NETWORK_INTERFACE_SETPRIV,
 >  
 >  should be:
 >  
 >  +                    KAUTH_REQ_NETWORK_INTERFACE_BRIDGE_SETPRIV,

 I can verify that this one-line change does solve the problem.

 - Geoff

From: Geoff Adams <gadams+netbsd@avernus.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/46234: brconfig add * does not work
Date: Wed, 21 Mar 2012 21:48:44 -0700

 On 21 Mar 2012, at 9:43 PM, Geoff Adams wrote:

 > I can verify that this one-line change does solve the problem.

 In case that was unclear, I mean that I have tested it, and it does, in =
 fact, solve the problem.

 - Geoff=

From: Ryo ONODERA <ryo_on@yk.rim.or.jp>
To: gnats-bugs@NetBSD.org, gadams+netbsd@avernus.com,
 mm_lists@pulsar-zone.net
Cc: 
Subject: Re: kern/46234: brconfig add * does not work
Date: Thu, 22 Mar 2012 21:10:53 +0900 (JST)

 Hi,

 From: Geoff Adams <gadams+netbsd@avernus.com>, Date: Thu, 22 Mar 2012 04:50:05 +0000 (UTC)

 > The following reply was made to PR kern/46234; it has been noted by GNATS.
 > 
 > From: Geoff Adams <gadams+netbsd@avernus.com>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/46234: brconfig add * does not work
 > Date: Wed, 21 Mar 2012 21:48:44 -0700
 > 
 >  On 21 Mar 2012, at 9:43 PM, Geoff Adams wrote:
 >  
 >  > I can verify that this one-line change does solve the problem.
 >  
 >  In case that was unclear, I mean that I have tested it, and it does, in =
 >  fact, solve the problem.

 On my machine, works fine too.
 elad@ also suggests same patch.

 Could someone commit this?

 Thank you.

 -- 
 Ryo ONODERA // ryo_on@yk.rim.or.jp
 PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 22 Mar 2012 12:59:40 +0000
State-Changed-Why:
Committed, thanks everyone :)


From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46234 CVS commit: src/sys/net
Date: Thu, 22 Mar 2012 12:59:33 +0000

 Module Name:	src
 Committed By:	wiz
 Date:		Thu Mar 22 12:59:33 UTC 2012

 Modified Files:
 	src/sys/net: if_bridge.c

 Log Message:
 Fix typo in kauth name. From PR 46234 by Matthew Mondor.
 Tested by Geoff Adams and Ryo ONODERA.


 To generate a diff of this commit:
 cvs rdiff -u -r1.75 -r1.76 src/sys/net/if_bridge.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.