Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145522308
D33263.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D33263.diff
View Options
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -84,6 +84,7 @@
#include <net/if_types.h>
#include <net/if_var.h>
#include <net/if_media.h>
+#include <net/if_mib.h>
#include <net/if_vlan_var.h>
#include <net/radix.h>
#include <net/route.h>
@@ -305,19 +306,25 @@
VNET_DEFINE(struct hhook_head *, ipsec_hhh_in[HHOOK_IPSEC_COUNT]);
VNET_DEFINE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]);
-VNET_DEFINE(int, if_index);
int ifqmaxlen = IFQ_MAXLEN;
VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */
VNET_DEFINE(struct ifgrouphead, ifg_head);
-VNET_DEFINE_STATIC(int, if_indexlim) = 8;
-
/* Table of ifnet by index. */
-VNET_DEFINE_STATIC(struct ifnet **, ifindex_table);
-
+VNET_DEFINE_STATIC(int, if_index);
+#define V_if_index VNET(if_index)
+VNET_DEFINE_STATIC(int, if_indexlim) = 8;
#define V_if_indexlim VNET(if_indexlim)
+VNET_DEFINE_STATIC(struct ifnet **, ifindex_table);
#define V_ifindex_table VNET(ifindex_table)
+SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system,
+ CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "Variables global to all interfaces");
+SYSCTL_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount,
+ CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(if_index), 0,
+ "Number of configured interfaces");
+
/*
* The global network interface list (V_ifnet) and related state (such as
* if_index, if_indexlim, and ifindex_table) are protected by an sxlock.
diff --git a/sys/net/if_mib.c b/sys/net/if_mib.c
--- a/sys/net/if_mib.c
+++ b/sys/net/if_mib.c
@@ -64,15 +64,6 @@
* services stuff).
*/
-SYSCTL_DECL(_net_link_generic);
-static SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system,
- CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
- "Variables global to all interfaces");
-
-SYSCTL_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount,
- CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(if_index), 0,
- "Number of configured interfaces");
-
static int
sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */
{
@@ -147,6 +138,7 @@
return error;
}
+SYSCTL_DECL(_net_link_generic);
static SYSCTL_NODE(_net_link_generic, IFMIB_IFDATA, ifdata,
CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ifdata,
"Interface table");
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -629,12 +629,10 @@
VNET_DECLARE(struct ifnethead, ifnet);
VNET_DECLARE(struct ifgrouphead, ifg_head);
-VNET_DECLARE(int, if_index);
VNET_DECLARE(struct ifnet *, loif); /* first loopback interface */
#define V_ifnet VNET(ifnet)
#define V_ifg_head VNET(ifg_head)
-#define V_if_index VNET(if_index)
#define V_loif VNET(loif)
#ifdef MCAST_VERBOSE
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 21, 11:05 PM (8 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28928910
Default Alt Text
D33263.diff (2 KB)
Attached To
Mode
D33263: ifnet_byindex() actually requires network epoch
Attached
Detach File
Event Timeline
Log In to Comment