diff options
author | 2015-10-29 15:04:54 +0000 | |
---|---|---|
committer | 2015-10-29 15:04:54 +0000 | |
commit | 91beba307615dcb092c687374ae54dd72e9b55a1 (patch) | |
tree | 9e94224898bc2e1a00481bf50de3ca44176960d4 | |
parent | Kill a comment saying that rt_ifp may not be the same as ifp, that's no (diff) | |
download | wireguard-openbsd-91beba307615dcb092c687374ae54dd72e9b55a1.tar.xz wireguard-openbsd-91beba307615dcb092c687374ae54dd72e9b55a1.zip |
Add some setsockopt hacks for libisc, aka John Frum
-rw-r--r-- | sys/kern/kern_pledge.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 53133f24ee9..6a8cf66262d 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.91 2015/10/29 12:51:06 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.92 2015/10/29 15:04:54 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1218,6 +1218,18 @@ pledge_sockopt_check(struct proc *p, int set, int level, int optname) break; } + /* DNS resolver may do these requests */ + if ((p->p_p->ps_pledge & PLEDGE_DNS)) { + switch (level) { + case IPPROTO_IPV6: + switch (optname) { + case IPV6_RECVPKTINFO: + case IPV6_USE_MIN_MTU: + return (0); + } + } + } + if ((p->p_p->ps_pledge & (PLEDGE_INET|PLEDGE_UNIX)) == 0) return (EINVAL); switch (level) { |