From root@blok52.atlantis.bg  Sun Sep  8 01:10:53 2002
Return-Path: <root@blok52.atlantis.bg>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D931A37B409
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Sep 2002 01:10:53 -0700 (PDT)
Received: from blok52.atlantis.bg (blok52.atlantis.bg [193.108.24.226])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AC04443E42
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Sep 2002 01:10:52 -0700 (PDT)
	(envelope-from root@blok52.atlantis.bg)
Received: by blok52.atlantis.bg (Postfix, from userid 0)
	id DE125AA0E; Sun,  8 Sep 2002 11:10:50 +0300 (EEST)
Message-Id: <20020908081050.DE125AA0E@blok52.atlantis.bg>
Date: Sun,  8 Sep 2002 11:10:50 +0300 (EEST)
From: Vasil Dimov <vd@etrade.bg>
Reply-To: vd@etrade.bg
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ifconfig.core, nonsense syntax causes "Segmentation fault" in ifconfig
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42544
>Category:       bin
>Synopsis:       ifconfig.core, nonsense syntax causes "Segmentation fault" in ifconfig
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 08 01:20:00 PDT 2002
>Closed-Date:    Tue Oct 01 19:18:24 PDT 2002
>Last-Modified:  Tue Oct 01 19:18:24 PDT 2002
>Originator:     Vasil Dimov
>Release:        FreeBSD 4.7-PRERELEASE i386
>Organization:
none
>Environment:
System: FreeBSD polejan.bl-52.studgrad.net 4.7-PRERELEASE FreeBSD 4.7-PRERELEASE #0: Thu Sep 5 21:09:57 EEST 2002 root@polejan.bl-52.studgrad.net:/usr/obj/usr/src/sys/POLEJAN i386
>Description:

everything of the form:
ifconfig IF ether WHATEVER -alias
(where IF is any existing interface and WHATEVER is some non-empty string)
causes ifconfig to crash.

Of-course there is no sense in typing things like that, by ifconfig.core
is not the right reaction of the program.

This is not somethig new (in 4.7) it surely happens in 4.6-STABLE and
probably previous versions. I just did not had the time to submit it
earlier, also I wasn't able to mail to @freebsd.org, because of the
"450 Client host rejected: cannot find your hostname" Postfix err.

>How-To-Repeat:
As I suppose everyone has the loopback interface so the following should do:
ifconfig lo0 ether 0 -alias
>Fix:
cd /usr/src/sbin/ifconfig && hack
>Release-Note:
>Audit-Trail:

From: Mike Makonnen <makonnen@pacbell.net>
To: vd@etrade.bg
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/42544: ifconfig.core,
 nonsense syntax causes "Segmentation fault" in ifconfig
Date: Sun, 08 Sep 2002 05:11:44 -0700

 Hello Vasil,
 
 Please apply the following patch. It should fix your problem.
 
 Cheers,
 Mike Makonnen.
 
 Index: sbin/ifconfig/ifconfig.c
 ===================================================================
 RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.c,v
 retrieving revision 1.79
 diff -u -r1.79 ifconfig.c
 --- sbin/ifconfig/ifconfig.c	19 Aug 2002 15:18:24 -0000	1.79
 +++ sbin/ifconfig/ifconfig.c	8 Sep 2002 12:05:12 -0000
 @@ -963,9 +963,10 @@
  notealias(const char *addr, int param, int s, const struct afswtch *afp)
  {
  	if (setaddr && doalias == 0 && param < 0)
 -		bcopy((caddr_t)rqtosa(af_addreq),
 -		      (caddr_t)rqtosa(af_ridreq),
 -		      rqtosa(af_addreq)->sa_len);
 +		if (afp->af_addreq != NULL && afp->af_ridreq != NULL)
 +			bcopy((caddr_t)rqtosa(af_addreq),
 +			      (caddr_t)rqtosa(af_ridreq),
 +			      rqtosa(af_addreq)->sa_len);
  	doalias = param;
  	if (param < 0) {
  		clearaddr = 1;
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Tue Oct 1 19:18:01 PDT 2002 
State-Changed-Why:  
Proposed patch committed to -current. 

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