From nobody@FreeBSD.org  Sun Jul  7 22:22:57 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4FCCB37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  7 Jul 2002 22:22:57 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EE23943E3B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  7 Jul 2002 22:22:56 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g685MkOT039570
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 7 Jul 2002 22:22:46 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g685MkxA039569;
	Sun, 7 Jul 2002 22:22:46 -0700 (PDT)
Message-Id: <200207080522.g685MkxA039569@www.freebsd.org>
Date: Sun, 7 Jul 2002 22:22:46 -0700 (PDT)
From: "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ifconfig fails to set both mac and ip address with a single command
X-Send-Pr-Version: www-1.0

>Number:         40322
>Category:       bin
>Synopsis:       ifconfig fails to set both mac and ip address with a single command
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 07 22:30:01 PDT 2002
>Closed-Date:    Mon Jul 08 00:37:59 PDT 2002
>Last-Modified:  Mon Jul 08 00:37:59 PDT 2002
>Originator:     Michael O. Boev
>Release:        4.6-RELEASE
>Organization:
Tomsk Regional Information Center
>Environment:
FreeBSD gw.tric.tomsk.gov.ru 4.6-RELEASE-p1 FreeBSD 4.6-RELEASE-p1 #1: Fri Jul  5 08:35:20 NOVST 2002     root@isrv.tric.tomsk.gov.ru:/usr/obj/usr/src/sys/GW  i386

>Description:
ifconfig fails to set both mac and ip address with a single command
a command of the kind:
ifconfig ed0 ether 01:02:03:04:05:06 inet 1.2.3.4
fails with the words:
"can't set link-level netmask or broadcast".
>How-To-Repeat:
run the following command as root:
ifconfig ed0 ether 01:02:03:04:05:06 inet 1.2.3.4
where ed0 is an ethernet interface 
(substitute any ifname and addresses)
>Fix:
   My investigation revealed that this error message was introduced during the MFC at /src/sbin/ifconfig/ifconfig.c, version 1.51.2.16, 2002/04/03 by ru. I suspect that since I've no real intention to set any link level netmask or broadcasts, there must be an programming error somewhere in ifconfig.c, I even may guess it is in the
"setifaddr" function, but I can't say it for sure, because I lack knowledge to understand the code in whole.
   
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dougb 
State-Changed-When: Mon Jul 8 00:35:28 PDT 2002 
State-Changed-Why:  

The man page describes why this is true: 

SYNOPSIS 
ifconfig [-L] [-m] interface [create] [address_family] 
... 

Both ether and inet are considered "address families" for this purpose. 

If this is confusing to you, feel free to follow up on freebsd-questions. 

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