summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2009-02-05 14:06:09 +0000
committerjamie <jamie@FreeBSD.org>2009-02-05 14:06:09 +0000
commit12bbe1869f5926ca7e3457f5424afdca31a1189b (patch)
tree71fe0b10296684e7094a545ca78ed6f72789d82d /sys/net/if.c
parent2926f8fa435de3f0b595eb5309b2a0c364703371 (diff)
downloadFreeBSD-src-12bbe1869f5926ca7e3457f5424afdca31a1189b.zip
FreeBSD-src-12bbe1869f5926ca7e3457f5424afdca31a1189b.tar.gz
Standardize the various prison_foo_ip[46] functions and prison_if to
return zero on success and an error code otherwise. The possible errors are EADDRNOTAVAIL if an address being checked for doesn't match the prison, and EAFNOSUPPORT if the prison doesn't have any addresses in that address family. For most callers of these functions, use the returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or EINVAL. Always include a jailed() check in these functions, where a non-jailed cred always returns success (and makes no changes). Remove the explicit jailed() checks that preceded many of the function calls. Approved by: bz (mentor)
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 2fb8e23..6966a51 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2271,8 +2271,7 @@ again:
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa = ifa->ifa_addr;
- if (jailed(curthread->td_ucred) &&
- !prison_if(curthread->td_ucred, sa))
+ if (prison_if(curthread->td_ucred, sa) != 0)
continue;
addrs++;
#ifdef COMPAT_43
OpenPOWER on IntegriCloud