From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 11 10:00:15 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F41BF16A400 for ; Sun, 11 Mar 2007 10:00:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id E0D0313C4B8 for ; Sun, 11 Mar 2007 10:00:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l2BA0EpZ023531 for ; Sun, 11 Mar 2007 10:00:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l2BA0EW7023530; Sun, 11 Mar 2007 10:00:14 GMT (envelope-from gnats) Date: Sun, 11 Mar 2007 10:00:14 GMT Message-Id: <200703111000.l2BA0EW7023530@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Brooks Davis Cc: Subject: Re: kern/83622: [patch] add network interfaces labeling support X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Brooks Davis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2007 10:00:15 -0000 The following reply was made to PR kern/83622; it has been noted by GNATS. From: Brooks Davis To: bug-followup@freebsd.org, novel@freebsd.org Cc: Subject: Re: kern/83622: [patch] add network interfaces labeling support Date: Sun, 11 Mar 2007 18:30:19 +0900 I'd like to see ifr_data replaced with a pointer+size which would allow using a single malloc and avoid hard coding the maximum size at 64-bytes (I'd use MAXPHYS instead). Here's a (totally untested concept patch if you want to give it a try. I keep meaning to do it, but haven't gotten around to it. -- Brooks Index: if.h =================================================================== RCS file: /usr/cvs/src/sys/net/if.h,v retrieving revision 1.105 diff -u -p -r1.105 if.h --- if.h 6 Sep 2006 21:51:58 -0000 1.105 +++ if.h 11 Mar 2007 09:18:09 -0000 @@ -283,6 +283,10 @@ struct ifreq { struct sockaddr ifru_addr; struct sockaddr ifru_dstaddr; struct sockaddr ifru_broadaddr; + struct { + voidd *data; + size_t len; + } ifru_sdata; short ifru_flags[2]; short ifru_index; int ifru_metric; @@ -295,6 +299,8 @@ struct ifreq { #define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +#define ifr_sdata ifr_ifru.ifru_sdata.data /* sized data pointer */ +#define ifr_sdatalen ifr_ifru.ifru_sdata.len /* sized data length */ #define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ #define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ #define ifr_metric ifr_ifru.ifru_metric /* metric */