Cosmetic: remove extraneous () on return statements, break a line
in two, join lines, compare pointers with NULL instead of testing their "truth."
This commit is contained in:
parent
fea99925e4
commit
fef0ee84d5
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: raw_ip6.c,v 1.82 2007/02/17 22:34:15 dyoung Exp $ */
|
||||
/* $NetBSD: raw_ip6.c,v 1.83 2007/02/22 09:30:33 dyoung Exp $ */
|
||||
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -62,7 +62,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.82 2007/02/17 22:34:15 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.83 2007/02/22 09:30:33 dyoung Exp $");
|
||||
|
||||
#include "opt_ipsec.h"
|
||||
|
||||
|
@ -567,7 +567,7 @@ rip6_output(m, va_alist)
|
|||
ip6_clearpktopts(&opt, -1);
|
||||
m_freem(control);
|
||||
}
|
||||
return (error);
|
||||
return error;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -597,11 +597,11 @@ rip6_ctloutput(int op, struct socket *so, int level, int optname,
|
|||
error = ip6_mrouter_get(optname, so, mp);
|
||||
else
|
||||
error = EINVAL;
|
||||
return (error);
|
||||
return error;
|
||||
case IPV6_CHECKSUM:
|
||||
return (ip6_raw_ctloutput(op, so, level, optname, mp));
|
||||
return ip6_raw_ctloutput(op, so, level, optname, mp);
|
||||
default:
|
||||
return (ip6_ctloutput(op, so, level, optname, mp));
|
||||
return ip6_ctloutput(op, so, level, optname, mp);
|
||||
}
|
||||
|
||||
case IPPROTO_ICMPV6:
|
||||
|
@ -609,7 +609,7 @@ rip6_ctloutput(int op, struct socket *so, int level, int optname,
|
|||
* XXX: is it better to call icmp6_ctloutput() directly
|
||||
* from protosw?
|
||||
*/
|
||||
return (icmp6_ctloutput(op, so, level, optname, mp));
|
||||
return icmp6_ctloutput(op, so, level, optname, mp);
|
||||
|
||||
default:
|
||||
if (op == PRCO_SETOPT && *mp)
|
||||
|
@ -639,31 +639,31 @@ rip6_usrreq(so, req, m, nam, control, l)
|
|||
priv++;
|
||||
|
||||
if (req == PRU_CONTROL)
|
||||
return (in6_control(so, (u_long)m, (caddr_t)nam,
|
||||
(struct ifnet *)control, l));
|
||||
return in6_control(so, (u_long)m, (caddr_t)nam,
|
||||
(struct ifnet *)control, l);
|
||||
|
||||
if (req == PRU_PURGEIF) {
|
||||
in6_pcbpurgeif0(&raw6cbtable, (struct ifnet *)control);
|
||||
in6_purgeif((struct ifnet *)control);
|
||||
in6_pcbpurgeif(&raw6cbtable, (struct ifnet *)control);
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (req) {
|
||||
case PRU_ATTACH:
|
||||
if (in6p)
|
||||
if (in6p != NULL)
|
||||
panic("rip6_attach");
|
||||
if (!priv) {
|
||||
error = EACCES;
|
||||
break;
|
||||
}
|
||||
s = splsoftnet();
|
||||
if ((error = soreserve(so, rip6_sendspace, rip6_recvspace)) != 0) {
|
||||
error = soreserve(so, rip6_sendspace, rip6_recvspace);
|
||||
if (error != 0) {
|
||||
splx(s);
|
||||
break;
|
||||
}
|
||||
if ((error = in6_pcballoc(so, &raw6cbtable)) != 0)
|
||||
{
|
||||
if ((error = in6_pcballoc(so, &raw6cbtable)) != 0) {
|
||||
splx(s);
|
||||
break;
|
||||
}
|
||||
|
@ -695,12 +695,12 @@ rip6_usrreq(so, req, m, nam, control, l)
|
|||
soisdisconnected(so);
|
||||
/* Fallthrough */
|
||||
case PRU_DETACH:
|
||||
if (in6p == 0)
|
||||
if (in6p == NULL)
|
||||
panic("rip6_detach");
|
||||
if (so == ip6_mrouter)
|
||||
ip6_mrouter_done();
|
||||
/* xxx: RSVP */
|
||||
if (in6p->in6p_icmp6filt) {
|
||||
if (in6p->in6p_icmp6filt != NULL) {
|
||||
FREE(in6p->in6p_icmp6filt, M_PCB);
|
||||
in6p->in6p_icmp6filt = NULL;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ rip6_usrreq(so, req, m, nam, control, l)
|
|||
if (addr->sin6_scope_id == 0 && !ip6_use_defzone)
|
||||
scope_ambiguous = 1;
|
||||
if ((error = sa6_embedscope(addr, ip6_use_defzone)) != 0)
|
||||
return(error);
|
||||
return error;
|
||||
|
||||
/* Source address selection. XXX: need pcblookup? */
|
||||
in6a = in6_selectsrc(addr, in6p->in6p_outputopts,
|
||||
|
@ -858,7 +858,7 @@ rip6_usrreq(so, req, m, nam, control, l)
|
|||
/*
|
||||
* stat: don't bother with a blocksize
|
||||
*/
|
||||
return (0);
|
||||
return 0;
|
||||
/*
|
||||
* Not supported.
|
||||
*/
|
||||
|
@ -883,7 +883,7 @@ rip6_usrreq(so, req, m, nam, control, l)
|
|||
}
|
||||
if (m != NULL)
|
||||
m_freem(m);
|
||||
return (error);
|
||||
return error;
|
||||
}
|
||||
|
||||
SYSCTL_SETUP(sysctl_net_inet6_raw6_setup, "sysctl net.inet6.raw6 subtree setup")
|
||||
|
|
Loading…
Reference in New Issue