diff options
author | 2010-09-30 09:18:18 +0000 | |
---|---|---|
committer | 2010-09-30 09:18:18 +0000 | |
commit | 2671c02f7e6b85cf3e145c67f3e532048a04a1a4 (patch) | |
tree | 414c8fc20ec46b8901116fd2fe66edb377bb2df1 /sys/netinet/ip_output.c | |
parent | Only 6 elements of mib are used so do allocate 6 not 7. (diff) | |
download | wireguard-openbsd-2671c02f7e6b85cf3e145c67f3e532048a04a1a4.tar.xz wireguard-openbsd-2671c02f7e6b85cf3e145c67f3e532048a04a1a4.zip |
If a caller is requesting to be set to the same rtable that they
currently have, let the call succeede.
Mirrors the same behaviour as setrtable()
OK claudio@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 506e1381465..801a363d616 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.213 2010/09/23 04:45:15 yasuoka Exp $ */ +/* $OpenBSD: ip_output.c,v 1.214 2010/09/30 09:18:18 phessler Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -1417,16 +1417,17 @@ ip_ctloutput(op, so, level, optname, mp) break; } rtid = *mtod(m, u_int *); - /* needs priviledges to switch when already set */ - if (p->p_p->ps_rtableid != 0 && suser(p, 0) != 0) { - error = EACCES; - break; - } /* table must exist */ if (!rtable_exists(rtid)) { error = EINVAL; break; } + /* needs priviledges to switch when already set */ + if (p->p_p->ps_rtableid != rtid && + p->p_p->ps_rtableid != 0 && suser(p, 0) != 0) { + error = EACCES; + break; + } inp->inp_rtableid = rtid; break; case IP_PIPEX: |