diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-07-29 09:31:03 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-07-29 09:31:03 +0000 |
commit | f16d022cdb8d8e2dd554328fcab7a465bc299a6b (patch) | |
tree | 2d1b9d4860c53587fc58fdb6a273531a9b33013c /sys/netinet6/ip6_output.c | |
parent | f33a4be603cb1fafeed67ddee8098f5ec15a334e (diff) | |
download | FreeBSD-src-f16d022cdb8d8e2dd554328fcab7a465bc299a6b.zip FreeBSD-src-f16d022cdb8d8e2dd554328fcab7a465bc299a6b.tar.gz |
Marginally decomplicate set/getsockopt code in ip6_output.c by simply
using the passed arguments explicitly and unconditionally rather than
testing them and calling panic(). The result is the same but easier
to read.
MFC after: 3 days
Diffstat (limited to 'sys/netinet6/ip6_output.c')
-rw-r--r-- | sys/netinet6/ip6_output.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index e2faaa6..492e93b 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1375,17 +1375,13 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) int optlen; struct thread *td; - if (sopt) { - level = sopt->sopt_level; - op = sopt->sopt_dir; - optname = sopt->sopt_name; - optlen = sopt->sopt_valsize; - td = sopt->sopt_td; - } else { - panic("ip6_ctloutput: arg soopt is NULL"); - } - error = optval = 0; - + level = sopt->sopt_level; + op = sopt->sopt_dir; + optname = sopt->sopt_name; + optlen = sopt->sopt_valsize; + td = sopt->sopt_td; + error = 0; + optval = 0; uproto = (int)so->so_proto->pr_protocol; if (level == IPPROTO_IPV6) { @@ -2051,13 +2047,10 @@ ip6_raw_ctloutput(struct socket *so, struct sockopt *sopt) struct in6pcb *in6p = sotoin6pcb(so); int level, op, optname; - if (sopt) { - level = sopt->sopt_level; - op = sopt->sopt_dir; - optname = sopt->sopt_name; - optlen = sopt->sopt_valsize; - } else - panic("ip6_raw_ctloutput: arg soopt is NULL"); + level = sopt->sopt_level; + op = sopt->sopt_dir; + optname = sopt->sopt_name; + optlen = sopt->sopt_valsize; if (level != IPPROTO_IPV6) { return (EINVAL); |