Date: Thu, 25 Sep 2008 20:47:36 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 150468 for review Message-ID: <200809252047.m8PKlaex065416@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150468 Change 150468 by zec@zec_tpx32 on 2008/09/25 20:46:55 Unbreak kernel build (modulo modules). Not tested. Contains junk. Needs revision. XXX. Affected files ... .. //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#10 edit .. //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/mlfk_ipl.c#4 edit .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#68 edit .. //depot/projects/vimage/src/sys/net/if.c#39 edit .. //depot/projects/vimage/src/sys/net/if_bridge.c#18 edit .. //depot/projects/vimage/src/sys/net/if_ethersubr.c#25 edit .. //depot/projects/vimage/src/sys/net/route.c#27 edit .. //depot/projects/vimage/src/sys/net/vnet.h#13 edit .. //depot/projects/vimage/src/sys/netinet/in.c#16 edit .. //depot/projects/vimage/src/sys/netinet/in_var.h#10 edit .. //depot/projects/vimage/src/sys/netinet/ip_fw.h#16 edit .. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#45 edit .. //depot/projects/vimage/src/sys/netinet/ip_icmp.c#18 edit .. //depot/projects/vimage/src/sys/netinet/ip_id.c#6 edit .. //depot/projects/vimage/src/sys/netinet/vinet.h#29 edit .. //depot/projects/vimage/src/sys/netinet6/in6_cksum.c#5 edit .. //depot/projects/vimage/src/sys/netinet6/in6_ifattach.c#24 edit .. //depot/projects/vimage/src/sys/netinet6/in6_src.c#22 edit .. //depot/projects/vimage/src/sys/netinet6/raw_ip6.c#24 edit .. //depot/projects/vimage/src/sys/nlm/nlm_prot.h#3 edit .. //depot/projects/vimage/src/sys/rpc/rpc.h#2 edit Differences ... ==== //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c#10 (text+ko) ==== @@ -127,11 +127,6 @@ # include <sys/vimage.h> # include <netinet/vinet.h> #endif -#if (__FreeBSD_version > 460000) -#ifndef VIMAGE -extern int path_mtu_discovery; -#endif -#endif # ifdef IPFILTER_M_IPFILTER MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures"); ==== //depot/projects/vimage/src/sys/contrib/ipfilter/netinet/mlfk_ipl.c#4 (text+ko) ==== @@ -43,7 +43,6 @@ static int ipf_modload(void); static int ipf_modunload(void); -SYSCTL_DECL(_net_inet); #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_ipf_int, "I", descr); ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#68 (text+ko) ==== @@ -504,7 +504,7 @@ struct vimage *vip = TD_TO_VIMAGE(td); struct vimage *vip_r = NULL; - error = suser(td); /* XXX replace with priv(9) */ + error = priv_check(td, PRIV_ROOT); if (error) return (error); ==== //depot/projects/vimage/src/sys/net/if.c#39 (text+ko) ==== @@ -203,7 +203,6 @@ { INIT_VNET_NET(curvnet); - INIT_VNET_NET(curvnet); IFNET_WLOCK_ASSERT(); V_ifindex_table[idx].ife_ifnet = ifp; @@ -212,7 +211,6 @@ struct ifaddr * ifaddr_byindex(u_short idx) { - INIT_VNET_NET(curvnet); struct ifaddr *ifa; IFNET_RLOCK(); @@ -238,7 +236,6 @@ { INIT_VNET_NET(curvnet); - INIT_VNET_NET(curvnet); IFNET_WLOCK(); V_ifindex_table[idx].ife_dev = cdev; IFNET_WUNLOCK(); @@ -2038,7 +2035,7 @@ switch (cmd) { #ifdef VIMAGE case SIOCSIFVIMAGE: - error = suser(td); + error = priv_check(td, PRIV_ROOT); if (error == 0) error = vi_if_move((struct vi_req *) data, NULL, TD_TO_VIMAGE(td)); ==== //depot/projects/vimage/src/sys/net/if_bridge.c#18 (text+ko) ==== @@ -3380,7 +3380,6 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, int snap, struct llc *llc) { - INIT_VNET_INET(curvnet); struct mbuf *m0; struct ip *ip; int error = -1; ==== //depot/projects/vimage/src/sys/net/if_ethersubr.c#25 (text+ko) ==== @@ -42,10 +42,12 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/mbuf.h> #include <sys/random.h> +#include <sys/rwlock.h> #include <sys/socket.h> #include <sys/sockio.h> #include <sys/sysctl.h> ==== //depot/projects/vimage/src/sys/net/route.c#27 (text+ko) ==== @@ -305,7 +305,6 @@ { INIT_VNET_NET(curvnet); struct radix_node_head *rnh; - INIT_VNET_NET(curvnet); struct rtentry *rt; struct radix_node *rn; struct rtentry *newrt; ==== //depot/projects/vimage/src/sys/net/vnet.h#13 (text+ko) ==== @@ -33,7 +33,6 @@ #ifndef _NET_VNET_H_ #define _NET_VNET_H_ -#ifdef VIMAGE #include "opt_route.h" #include <sys/proc.h> @@ -45,6 +44,8 @@ #include <net/route.h> #include <net/raw_cb.h> +#ifdef VIMAGE + struct vnet_net { int _if_index; struct ifindex_entry *_ifindex_table; ==== //depot/projects/vimage/src/sys/netinet/in.c#16 (text+ko) ==== @@ -72,7 +72,6 @@ static int subnetsarelocal; static int sameprefixcarponly; extern struct inpcbinfo ripcbinfo; -extern struct inpcbinfo udbinfo; #endif SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, subnets_are_local, ==== //depot/projects/vimage/src/sys/netinet/in_var.h#10 (text+ko) ==== ==== //depot/projects/vimage/src/sys/netinet/ip_fw.h#16 (text+ko) ==== @@ -642,8 +642,6 @@ extern ip_fw_chk_t *ip_fw_chk_ptr; #define IPFW_LOADED (ip_fw_chk_ptr != NULL) -#ifdef IPFW_INTERNAL - #define IPFW_TABLES_MAX 128 struct ip_fw_chain { struct ip_fw *rules; /* list of rules */ @@ -652,6 +650,9 @@ struct radix_node_head *tables[IPFW_TABLES_MAX]; struct rwlock rwmtx; }; + +#ifdef IPFW_INTERNAL + #define IPFW_LOCK_INIT(_chain) \ rw_init(&(_chain)->rwmtx, "IPFW static rules") #define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx) ==== //depot/projects/vimage/src/sys/netinet/ip_fw2.c#45 (text+ko) ==== @@ -2161,7 +2161,9 @@ * these types of constraints, as well as decrease contention * on pcb related locks. */ - struct ip_fw_ugid fw_ugid_cache; +#if 0 + struct ip_fw_ugid fw_ugid_cache; /* XXX Marko revisit this */ +#endif int ugid_lookup = 0; /* ==== //depot/projects/vimage/src/sys/netinet/ip_icmp.c#18 (text+ko) ==== @@ -77,47 +77,51 @@ * host table maintenance routines. */ +#ifndef VIMAGE struct icmpstat icmpstat; +static int icmpmaskrepl = 0; +static u_int icmpmaskfake = 0; +static int drop_redirect = 0; +static int log_redirect = 0; +static int icmplim = 200; +static int icmplim_output = 1; +static char reply_src[IFNAMSIZ]; +static int icmp_rfi = 0; +static int icmp_quotelen = 8; +static int icmpbmcastecho = 0; +#endif + SYSCTL_V_STRUCT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW, icmpstat, icmpstat, ""); -static int icmpmaskrepl = 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, icmpmaskrepl, 0, "Reply to ICMP Address Mask Request packets."); -static u_int icmpmaskfake = 0; SYSCTL_V_UINT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_RW, icmpmaskfake, 0, "Fake reply to ICMP Address Mask Request packets."); -static int drop_redirect = 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, drop_redirect, 0, "Ignore ICMP redirects"); -static int log_redirect = 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, log_redirect, 0, "Log ICMP redirects to the console"); -static int icmplim = 200; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, icmplim, 0, "Maximum number of ICMP responses per second"); -static int icmplim_output = 1; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, icmplim_output, 0, "Enable rate limiting of ICMP responses"); -static char reply_src[IFNAMSIZ]; SYSCTL_V_STRING(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, reply_src, IFNAMSIZ, "icmp reply source for non-local packets."); -static int icmp_rfi = 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_RW, icmp_rfi, 0, "ICMP reply from incoming interface for " "non-local packets"); -static int icmp_quotelen = 8; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_RW, icmp_quotelen, 0, "Number of bytes from original packet to " "quote in ICMP reply"); @@ -125,8 +129,6 @@ /* * ICMP broadcast echo sysctl */ - -static int icmpbmcastecho = 0; SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, icmpbmcastecho, 0, ""); ==== //depot/projects/vimage/src/sys/netinet/ip_id.c#6 (text+ko) ==== @@ -85,9 +85,11 @@ #include <sys/random.h> #include <sys/systm.h> #include <sys/sysctl.h> +#include <sys/bitstring.h> + #include <netinet/in.h> +#include <netinet/in_var.h> #include <netinet/ip_var.h> -#include <sys/bitstring.h> static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state"); @@ -104,7 +106,6 @@ MTX_SYSINIT(ip_id_mtx, &ip_id_mtx, "ip_id_mtx", MTX_DEF); -SYSCTL_DECL(_net_inet_ip); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, CTLTYPE_INT|CTLFLAG_RW, &array_size, 0, sysctl_ip_id_change, "IU", "IP ID Array size"); SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_collisions, CTLFLAG_RD, ==== //depot/projects/vimage/src/sys/netinet/vinet.h#29 (text+ko) ==== @@ -33,11 +33,12 @@ #ifndef _NETINET_VINET_H_ #define _NETINET_VINET_H_ -#ifdef VIMAGE #include <sys/socketvar.h> #include <sys/sysctl.h> #include <sys/md5.h> +#include <net/vnet.h> /* XXX revisit this! */ + #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/in_var.h> @@ -54,6 +55,8 @@ #include <netinet/udp.h> #include <netinet/udp_var.h> +#ifdef VIMAGE + struct vnet_inet { struct in_ifaddrhashhead *_in_ifaddrhashtbl; struct in_ifaddrhead _in_ifaddrhead; ==== //depot/projects/vimage/src/sys/netinet6/in6_cksum.c#5 (text+ko) ==== @@ -66,6 +66,9 @@ #include <sys/param.h> #include <sys/mbuf.h> #include <sys/systm.h> + +#include <net/vnet.h> + #include <netinet/in.h> #include <netinet/ip6.h> #include <netinet6/scope6_var.h> ==== //depot/projects/vimage/src/sys/netinet6/in6_ifattach.c#24 (text+ko) ==== @@ -69,7 +69,6 @@ int ip6_auto_linklocal; struct callout in6_tmpaddrtimer_ch; extern struct inpcbinfo ripcbinfo; -extern struct inpcbinfo udbinfo; #endif static int get_rand_ifid(struct ifnet *, struct in6_addr *); ==== //depot/projects/vimage/src/sys/netinet6/in6_src.c#22 (text+ko) ==== @@ -463,7 +463,6 @@ struct ifnet **retifp, struct rtentry **retrt, int clone, int norouteok) { - INIT_VNET_NET(curvnet); INIT_VNET_INET6(curvnet); int error = 0; struct ifnet *ifp = NULL; ==== //depot/projects/vimage/src/sys/netinet6/raw_ip6.c#24 (text+ko) ==== @@ -770,7 +770,6 @@ rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { - INIT_VNET_INET(so->so_vnet); struct inpcb *inp; struct sockaddr_in6 tmp; struct sockaddr_in6 *dst; ==== //depot/projects/vimage/src/sys/nlm/nlm_prot.h#3 (text+ko) ==== ==== //depot/projects/vimage/src/sys/rpc/rpc.h#2 (text+ko) ==== @@ -42,6 +42,7 @@ #ifndef _RPC_RPC_H #define _RPC_RPC_H +#include <sys/param.h> #include <rpc/types.h> /* some typedefs */ #include <sys/socket.h> #include <netinet/in.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809252047.m8PKlaex065416>