summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2013-11-22 05:01:38 +0000
committerluigi <luigi@FreeBSD.org>2013-11-22 05:01:38 +0000
commit9b36fc77a208f9a7efc591425d19845509048bcf (patch)
treefd4c1a6a36af1776f898b9236af2e32f51f9a908 /sys/netpfil
parentf0a80e6e72562283f4249c7ec486b0f5c039f3ec (diff)
downloadFreeBSD-src-9b36fc77a208f9a7efc591425d19845509048bcf.zip
FreeBSD-src-9b36fc77a208f9a7efc591425d19845509048bcf.tar.gz
disable some ipfw match options when compiling in userspace
Diffstat (limited to 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw2.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c
index aa6d9e3..8540bdf 100644
--- a/sys/netpfil/ipfw/ip_fw2.c
+++ b/sys/netpfil/ipfw/ip_fw2.c
@@ -370,7 +370,7 @@ iface_match(struct ifnet *ifp, ipfw_insn_if *cmd, struct ip_fw_chain *chain, uin
return(1);
}
} else {
-#ifdef __FreeBSD__ /* and OSX too ? */
+#if !defined(USERSPACE) && defined(__FreeBSD__) /* and OSX too ? */
struct ifaddr *ia;
if_addr_rlock(ifp);
@@ -413,7 +413,7 @@ iface_match(struct ifnet *ifp, ipfw_insn_if *cmd, struct ip_fw_chain *chain, uin
static int
verify_path(struct in_addr src, struct ifnet *ifp, u_int fib)
{
-#ifndef __FreeBSD__
+#if defined(USERSPACE) || !defined(__FreeBSD__)
return 0;
#else
struct route ro;
@@ -664,6 +664,9 @@ static int
check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp,
struct ucred **uc)
{
+#if defined(USERSPACE)
+ return 0; // not supported in userspace
+#else
#ifndef __FreeBSD__
/* XXX */
return cred_check(insn, proto, oif,
@@ -766,6 +769,7 @@ check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp,
match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]);
return (match);
#endif /* __FreeBSD__ */
+#endif /* not supported in userspace */
}
/*
@@ -1464,6 +1468,7 @@ do { \
key = htonl(dst_port);
else if (v == 3)
key = htonl(src_port);
+#ifndef USERSPACE
else if (v == 4 || v == 5) {
check_uidgid(
(ipfw_insn_u32 *)cmd,
@@ -1483,6 +1488,7 @@ do { \
#endif /* !__FreeBSD__ */
key = htonl(key);
} else
+#endif /* !USERSPACE */
break;
}
match = ipfw_lookup_table(chain,
@@ -1946,6 +1952,7 @@ do { \
break;
case O_SOCKARG: {
+#ifndef USERSPACE /* not supported in userspace */
struct inpcb *inp = args->inp;
struct inpcbinfo *pi;
@@ -1986,6 +1993,7 @@ do { \
match = 1;
}
}
+#endif /* !USERSPACE */
break;
}
OpenPOWER on IntegriCloud