PERFORCE change 161158 for review
Marko Zec
zec at FreeBSD.org
Sun Apr 26 23:26:50 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=161158
Change 161158 by zec at zec_amdx2 on 2009/04/26 23:26:22
Unbreak GENERIC and VIMAGE kernel builds.
Affected files ...
.. //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 edit
.. //depot/projects/vimage/src/sys/net/if.c#79 edit
.. //depot/projects/vimage/src/sys/net/if_mib.c#14 edit
.. //depot/projects/vimage/src/sys/net/rtsock.c#33 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_base.c#56 edit
.. //depot/projects/vimage/src/sys/netinet/igmp.c#35 edit
.. //depot/projects/vimage/src/sys/netinet/in_mcast.c#26 edit
.. //depot/projects/vimage/src/sys/netinet/ip_divert.c#30 edit
.. //depot/projects/vimage/src/sys/netinet6/in6_rmx.c#34 edit
Differences ...
==== //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#18 (text+ko) ====
@@ -246,7 +246,6 @@
fr_running = 1;
if (fr_control_forwarding & 1) {
- INIT_VNET_INET(curvnet);
V_ipforwarding = 1;
}
@@ -272,7 +271,6 @@
int s;
#endif
if (fr_control_forwarding & 2) {
- INIT_VNET_INET(curvnet);
V_ipforwarding = 0;
}
==== //depot/projects/vimage/src/sys/net/if.c#79 (text+ko) ====
@@ -571,6 +571,7 @@
static void
if_free_internal(struct ifnet *ifp)
{
+ INIT_VNET_NET(ifp->if_vnet);
KASSERT((ifp->if_flags & IFF_DYING),
("if_free_internal: interface not dying"));
@@ -608,7 +609,6 @@
void
if_free_type(struct ifnet *ifp, u_char type)
{
- INIT_VNET_NET(curvnet); /* ifp->if_vnet can be NULL here ! */
KASSERT(ifp->if_alloctype == type,
("if_free_type: type (%d) != alloctype (%d)", type,
==== //depot/projects/vimage/src/sys/net/if_mib.c#14 (text+ko) ====
@@ -77,7 +77,6 @@
static int
sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */
{
- INIT_VNET_NET(curvnet);
int *name = (int *)arg1;
int error;
u_int namelen = arg2;
==== //depot/projects/vimage/src/sys/net/rtsock.c#33 (text+ko) ====
@@ -1206,6 +1206,7 @@
static void
rt_dispatch(struct mbuf *m, const struct sockaddr *sa)
{
+ INIT_VNET_NET(curvnet);
struct m_tag *tag;
/*
==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#56 (text+ko) ====
@@ -84,8 +84,6 @@
/* Mutex to protect topology events. */
static struct mtx ng_topo_mtx;
-static vnet_attach_fn vnet_netgraph_iattach;
-
#ifdef NETGRAPH_DEBUG
static struct mtx ng_nodelist_mtx; /* protects global node/hook lists */
static struct mtx ngq_mtx; /* protects the queue item list */
@@ -273,19 +271,6 @@
static vnet_detach_fn vnet_netgraph_idetach;
#endif /* VIMAGE */
-#ifndef VIMAGE_GLOBALS
-static vnet_modinfo_t vnet_netgraph_modinfo = {
- .vmi_id = VNET_MOD_NETGRAPH,
- .vmi_name = "netgraph",
- .vmi_size = sizeof(struct vnet_netgraph),
- .vmi_dependson = VNET_MOD_LOIF,
- .vmi_iattach = vnet_netgraph_iattach,
-#ifdef VIMAGE
- .vmi_idetach = vnet_netgraph_idetach
-#endif
-};
-#endif
-
#ifdef NETGRAPH_DEBUG /*----------------------------------------------*/
/*
* In debug mode:
@@ -3091,26 +3076,18 @@
}
#ifndef VIMAGE_GLOBALS
-static const vnet_modinfo_t vnet_netgraph_modinfo = {
+static vnet_modinfo_t vnet_netgraph_modinfo = {
.vmi_id = VNET_MOD_NETGRAPH,
.vmi_name = "netgraph",
+ .vmi_size = sizeof(struct vnet_netgraph),
+ .vmi_dependson = VNET_MOD_LOIF,
+ .vmi_iattach = vnet_netgraph_iattach,
#ifdef VIMAGE
- .vmi_size = sizeof(struct vnet_netgraph),
+ .vmi_idetach = vnet_netgraph_idetach
#endif
- .vmi_iattach = vnet_netgraph_iattach
};
#endif
-static int
-vnet_netgraph_iattach(const void *arg __unused)
-{
- INIT_VNET_NETGRAPH(curvnet);
-
- V_nextID = 1;
-
- return (0);
-}
-
/*
* Handle loading and unloading for this code.
* The only thing we need to link into is the NETISR strucure.
==== //depot/projects/vimage/src/sys/netinet/igmp.c#35 (text+ko) ====
@@ -2053,7 +2053,6 @@
{
INIT_VNET_INET(curvnet);
- INIT_VNET_INET(curvnet);
IGMP_LOCK_ASSERT();
if (igi->igi_v1_timer == 0 && igi->igi_v2_timer == 0) {
@@ -3374,7 +3373,6 @@
* unique to each VIMAGE and must be retrieved.
*/
CURVNET_SET((struct vnet *)(m->m_pkthdr.header));
- INIT_VNET_INET(curvnet);
INIT_VNET_NET(curvnet);
INIT_VNET_INET(curvnet);
ifindex = igmp_restore_context(m);
@@ -3616,7 +3614,6 @@
return (0);
}
-#ifdef VIMAGE
static int
vnet_igmp_idetach(const void *unused __unused)
{
@@ -3629,35 +3626,14 @@
return (0);
}
-#endif
-
-struct vnet_igmp {
- int dummy;
-};
-#ifndef VIMAGE
-#ifndef VIMAGE_GLOBALS
-struct vnet_igmp vnet_igmp_0;
-#endif
-#endif
-/* XXX VIMAGE [julian]
- * BMS seems unsure if this should be a separate module or not as he's
- * put the extra fields into vnet_inet instead of a vnet_igmp.
- * yet it has module setup functions..
- */
#ifndef VIMAGE_GLOBALS
- VNET_SYMMAP(inet, igi_head),
- VNET_SYMMAP(inet, igmpstat),
-};
static vnet_modinfo_t vnet_igmp_modinfo = {
.vmi_id = VNET_MOD_IGMP,
.vmi_name = "igmp",
.vmi_dependson = VNET_MOD_INET,
- .vmi_symmap = vnet_igmp_symmap,
.vmi_iattach = vnet_igmp_iattach,
-#ifdef VIMAGE
.vmi_idetach = vnet_igmp_idetach
-#endif
};
#endif
==== //depot/projects/vimage/src/sys/netinet/in_mcast.c#26 (text+ko) ====
@@ -2307,7 +2307,6 @@
inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
{
INIT_VNET_NET(curvnet);
- INIT_VNET_INET(curvnet);
struct in_addr addr;
struct ip_mreqn mreqn;
struct ifnet *ifp;
==== //depot/projects/vimage/src/sys/netinet/ip_divert.c#30 (text+ko) ====
@@ -126,23 +126,6 @@
static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */
static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */
-static int
-div_inpcb_init(void *mem, int size, int flags)
-{
- struct inpcb *inp = mem;
-
- INP_LOCK_INIT(inp, "inp", "divinp");
- return (0);
-}
-
-static void
-div_inpcb_fini(void *mem, int size)
-{
- struct inpcb *inp = mem;
-
- INP_LOCK_DESTROY(inp);
-}
-
void
div_init(void)
{
==== //depot/projects/vimage/src/sys/netinet6/in6_rmx.c#34 (text+ko) ====
@@ -292,6 +292,7 @@
in6_rtqtimo(void *rock)
{
CURVNET_SET_QUIET((struct vnet *) rock);
+ INIT_VNET_NET(curvnet);
INIT_VNET_INET6(curvnet);
struct radix_node_head *rnh = V_rt_tables[0][AF_INET6];
struct rtqk_arg arg;
@@ -379,6 +380,7 @@
in6_mtutimo(void *rock)
{
CURVNET_SET_QUIET((struct vnet *) rock);
+ INIT_VNET_NET(curvnet);
INIT_VNET_INET6(curvnet);
struct radix_node_head *rnh = V_rt_tables[0][AF_INET6];
struct mtuex_arg arg;
More information about the p4-projects
mailing list