kern/83622: [patch] add network interfaces labeling support
Brooks Davis
brooks at one-eyed-alien.net
Sun Mar 11 10:00:15 UTC 2007
The following reply was made to PR kern/83622; it has been noted by GNATS.
From: Brooks Davis <brooks at one-eyed-alien.net>
To: bug-followup at freebsd.org, novel at 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 */
More information about the freebsd-bugs
mailing list