Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet KNF, no functional change.
details: https://anonhg.NetBSD.org/src/rev/e231bab06efa
branches: trunk
changeset: 994850:e231bab06efa
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Nov 24 17:05:54 2018 +0000
description:
KNF, no functional change.
diffstat:
sys/netinet/tcp_usrreq.c | 98 ++++++++++++++++++++++++------------------------
1 files changed, 49 insertions(+), 49 deletions(-)
diffs (truncated from 367 to 300 lines):
diff -r 696bfbe7b54a -r e231bab06efa sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c Sat Nov 24 16:58:40 2018 +0000
+++ b/sys/netinet/tcp_usrreq.c Sat Nov 24 17:05:54 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.220 2018/11/24 16:58:40 maxv Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.220 2018/11/24 16:58:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -152,8 +152,8 @@
#include <netinet/tcp_debug.h>
#include <netinet/tcp_vtw.h>
-static int
-tcp_debug_capture(struct tcpcb *tp, int req)
+static int
+tcp_debug_capture(struct tcpcb *tp, int req)
{
#ifdef TCP_DEBUG
return tp->t_state;
@@ -163,7 +163,7 @@
static inline void
tcp_debug_trace(struct socket *so, struct tcpcb *tp, int ostate, int req)
-{
+{
#ifdef TCP_DEBUG
if (tp && (so->so_options & SO_DEBUG))
tcp_trace(TA_USER, ostate, tp, NULL, req);
@@ -216,7 +216,7 @@
if (tp->t_state == TCPS_SYN_RECEIVED ||
tp->t_state == TCPS_SYN_SENT) {
TCP_TIMER_ARM(tp, TCPT_KEEP, tp->t_keepinit);
- } else if (so->so_options & SO_KEEPALIVE &&
+ } else if (so->so_options & SO_KEEPALIVE &&
tp->t_state <= TCPS_CLOSE_WAIT) {
TCP_TIMER_ARM(tp, TCPT_KEEP, tp->t_keepintvl);
} else {
@@ -330,7 +330,7 @@
#endif
{
splx(s);
- return (ECONNRESET);
+ return ECONNRESET;
}
if (level != IPPROTO_TCP) {
switch (family) {
@@ -344,7 +344,7 @@
#endif
}
splx(s);
- return (error);
+ return error;
}
if (inp)
tp = intotcpcb(inp);
@@ -487,7 +487,7 @@
break;
}
splx(s);
- return (error);
+ return error;
}
#ifndef TCP_SENDSPACE
@@ -1255,7 +1255,7 @@
if (tp)
(void) tcp_output(tp);
}
- return (tp);
+ return tp;
}
/*
@@ -1322,7 +1322,7 @@
tp = 0;
}
}
- return (tp);
+ return tp;
}
/*
@@ -1340,17 +1340,17 @@
node.sysctl_data = &mssdflt;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
if (error || newp == NULL)
- return (error);
+ return error;
if (mssdflt < 32)
- return (EINVAL);
+ return EINVAL;
tcp_mssdflt = mssdflt;
mutex_enter(softnet_lock);
tcp_tcpcb_template();
mutex_exit(softnet_lock);
- return (0);
+ return 0;
}
/*
@@ -1401,7 +1401,7 @@
struct sysctlnode node;
if (namelen != 0)
- return (EINVAL);
+ return EINVAL;
switch (name[-3]) {
case PF_INET:
@@ -1423,7 +1423,7 @@
break;
#endif /* INET6 */
default:
- return (EINVAL);
+ return EINVAL;
}
/*
@@ -1435,13 +1435,13 @@
node.sysctl_data = &tmp;
error = sysctl_lookup(SYSCTLFN_CALL(&node));
if (error || newp == NULL)
- return (error);
+ return error;
/*
* simple port range check
*/
if (tmp < 0 || tmp > 65535)
- return (EINVAL);
+ return EINVAL;
/*
* per-node range checks
@@ -1450,20 +1450,20 @@
case IPCTL_ANONPORTMIN:
case IPV6CTL_ANONPORTMIN:
if (tmp >= apmax)
- return (EINVAL);
+ return EINVAL;
#ifndef IPNOPRIVPORTS
if (tmp < IPPORT_RESERVED)
- return (EINVAL);
+ return EINVAL;
#endif /* IPNOPRIVPORTS */
break;
case IPCTL_ANONPORTMAX:
case IPV6CTL_ANONPORTMAX:
if (apmin >= tmp)
- return (EINVAL);
+ return EINVAL;
#ifndef IPNOPRIVPORTS
if (tmp < IPPORT_RESERVED)
- return (EINVAL);
+ return EINVAL;
#endif /* IPNOPRIVPORTS */
break;
@@ -1473,7 +1473,7 @@
if (tmp >= lpmax ||
tmp > IPPORT_RESERVEDMAX ||
tmp < IPPORT_RESERVEDMIN)
- return (EINVAL);
+ return EINVAL;
break;
case IPCTL_LOWPORTMAX:
@@ -1481,17 +1481,17 @@
if (lpmin >= tmp ||
tmp > IPPORT_RESERVEDMAX ||
tmp < IPPORT_RESERVEDMIN)
- return (EINVAL);
+ return EINVAL;
break;
#endif /* IPNOPRIVPORTS */
default:
- return (EINVAL);
+ return EINVAL;
}
*(int*)rnode->sysctl_data = tmp;
- return (0);
+ return 0;
}
static inline int
@@ -1524,14 +1524,14 @@
struct socket *sockp;
inp = in_pcblookup_connect(&tcbtable, raddr, rport, laddr, lport, 0);
-
+
if (inp == NULL || (sockp = inp->inp_socket) == NULL)
return ESRCH;
if (dodrop) {
struct tcpcb *tp;
int error;
-
+
if (inp == NULL || (tp = intotcpcb(inp)) == NULL ||
(inp->inp_socket->so_options & SO_ACCEPTCONN) != 0)
return ESRCH;
@@ -1539,13 +1539,13 @@
error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_SOCKET,
KAUTH_REQ_NETWORK_SOCKET_DROP, inp->inp_socket, tp, NULL);
if (error)
- return (error);
-
+ return error;
+
(void)tcp_drop(tp, ECONNABORTED);
return 0;
}
- else
- return copyout_uid(sockp, oldp, oldlenp);
+
+ return copyout_uid(sockp, oldp, oldlenp);
}
#ifdef INET6
@@ -1562,11 +1562,11 @@
if (in6p == NULL || (sockp = in6p->in6p_socket) == NULL)
return ESRCH;
-
+
if (dodrop) {
struct tcpcb *tp;
int error;
-
+
if (in6p == NULL || (tp = in6totcpcb(in6p)) == NULL ||
(in6p->in6p_socket->so_options & SO_ACCEPTCONN) != 0)
return ESRCH;
@@ -1574,13 +1574,13 @@
error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_SOCKET,
KAUTH_REQ_NETWORK_SOCKET_DROP, in6p->in6p_socket, tp, NULL);
if (error)
- return (error);
+ return error;
(void)tcp_drop(tp, ECONNABORTED);
return 0;
}
- else
- return copyout_uid(sockp, oldp, oldlenp);
+
+ return copyout_uid(sockp, oldp, oldlenp);
}
#endif
@@ -1632,7 +1632,7 @@
rport = (u_int)name[1];
laddr.s_addr = (uint32_t)name[2];
lport = (u_int)name[3];
-
+
mutex_enter(softnet_lock);
error = inet4_ident_core(raddr, rport, laddr, lport,
oldp, oldlenp, l, dodrop);
@@ -1692,7 +1692,7 @@
if (si4[0]->sin_len != sizeof(*si4[0]) ||
si4[0]->sin_len != sizeof(*si4[1]))
return EINVAL;
-
+
mutex_enter(softnet_lock);
error = inet4_ident_core(si4[0]->sin_addr, si4[0]->sin_port,
si4[1]->sin_addr, si4[1]->sin_port,
@@ -1729,7 +1729,7 @@
int error, elem_count, pf, proto, pf2;
if (namelen != 4)
- return (EINVAL);
+ return EINVAL;
if (oldp != NULL) {
len = *oldlenp;
@@ -1751,7 +1751,7 @@
return (sysctl_query(SYSCTLFN_CALL(rnode)));
if (name - oname != 4)
- return (EINVAL);
Home |
Main Index |
Thread Index |
Old Index