diff options
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/netgraph.h | 11 | ||||
-rw-r--r-- | sys/netgraph/ng_base.c | 1 | ||||
-rw-r--r-- | sys/netgraph/ng_eiface.c | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/sys/netgraph/netgraph.h b/sys/netgraph/netgraph.h index 78af963..0def641 100644 --- a/sys/netgraph/netgraph.h +++ b/sys/netgraph/netgraph.h @@ -1186,6 +1186,7 @@ typedef void *meta_p; /* Hash related definitions */ #define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */ +#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ /* Virtualization macros */ #define INIT_VNET_NETGRAPH(vnet) \ @@ -1194,6 +1195,16 @@ typedef void *meta_p; #define VNET_NETGRAPH(sym) VSYM(vnet_netgraph, sym) +struct vnet_netgraph { + LIST_HEAD(, ng_node) _ng_ID_hash[NG_ID_HASH_SIZE]; + LIST_HEAD(, ng_node) _ng_name_hash[NG_NAME_HASH_SIZE]; + LIST_HEAD(, ng_node) _ng_nodelist; + ng_ID_t _nextID; + struct unrhdr *_ng_iface_unit; + struct unrhdr *_ng_eiface_unit; + struct unrhdr *_ng_wormhole_unit; +}; + /* Symbol translation macros */ #define V_nextID VNET_NETGRAPH(nextID) #define V_ng_ID_hash VNET_NETGRAPH(ng_ID_hash) diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 263469a..24ed885 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -183,7 +183,6 @@ static struct mtx ng_idhash_mtx; } \ } while (0) -#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE]; static struct mtx ng_namehash_mtx; #define NG_NAMEHASH(NAME, HASH) \ diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 09011d2..1c952cd 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -447,8 +447,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook) caddr_t ptr; int buflen; -#define SA_SIZE(s) ((s)->sa_len<sizeof(*(s))? sizeof(*(s)):(s)->sa_len) - /* Determine size of response and allocate it */ buflen = 0; TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) @@ -474,7 +472,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook) buflen -= len; } break; -#undef SA_SIZE } default: |