aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2012-03-15 14:22:05 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2012-03-15 14:22:05 +0000
commitdea47f3999b953876cdc41f1dc06c2978ef67c2f (patch)
tree2744a7010f4e0fab3dde8a515b80568ba8e47eea /sys
parent99f293a20e2cda21db2843b2445717bc89a61fd2 (diff)
downloadsrc-dea47f3999b953876cdc41f1dc06c2978ef67c2f.tar.gz
src-dea47f3999b953876cdc41f1dc06c2978ef67c2f.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/sctp_usrreq.c27
-rw-r--r--sys/netinet6/sctp6_usrreq.c6
2 files changed, 14 insertions, 19 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index fe82da3bfed9..569ec9e8adf1 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -451,7 +451,7 @@ sctp_abort(struct socket *so)
uint32_t flags;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
return;
}
sctp_must_try_again:
@@ -569,7 +569,7 @@ sctp_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
return (EINVAL);
}
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (EINVAL);
}
@@ -585,7 +585,7 @@ sctp_close(struct socket *so)
uint32_t flags;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0)
+ if (inp == NULL)
return;
/*
@@ -650,7 +650,7 @@ sctp_sendm(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
int error;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
if (control) {
sctp_m_freem(control);
control = NULL;
@@ -979,7 +979,7 @@ sctp_shutdown(struct socket *so)
struct sctp_inpcb *inp;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (EINVAL);
}
@@ -1639,7 +1639,7 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
return (EINVAL);
}
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return EINVAL;
}
@@ -3317,7 +3317,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
return (EINVAL);
}
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_PRINTF("inp is NULL?\n");
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (EINVAL);
@@ -5765,12 +5765,6 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt)
void *p;
int error = 0;
- inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
- /* I made the same as TCP since we are not setup? */
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- return (ECONNRESET);
- }
if (sopt->sopt_level != IPPROTO_SCTP) {
/* wrong proto level... send back up to IP */
#ifdef INET6
@@ -5785,6 +5779,7 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt)
#endif
return (error);
}
+ inp = (struct sctp_inpcb *)so->so_pcb;
optsize = sopt->sopt_valsize;
if (optsize) {
SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT);
@@ -5828,7 +5823,7 @@ sctp_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
struct sctp_tcb *stcb = NULL;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
/* I made the same as TCP since we are not setup? */
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (ECONNRESET);
@@ -5988,7 +5983,7 @@ sctp_listen(struct socket *so, int backlog, struct thread *p)
struct sctp_inpcb *inp;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
/* I made the same as TCP since we are not setup? */
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (ECONNRESET);
@@ -6152,7 +6147,7 @@ sctp_accept(struct socket *so, struct sockaddr **addr)
#endif
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (ECONNRESET);
}
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index a002d0d5b4c2..c1196260eb21 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -632,7 +632,7 @@ sctp6_abort(struct socket *so)
uint32_t flags;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
return;
}
@@ -720,7 +720,7 @@ sctp6_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
int error;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL);
return (EINVAL);
}
@@ -960,7 +960,7 @@ sctp6_connect(struct socket *so, struct sockaddr *addr, struct thread *p)
inp6 = (struct in6pcb *)so->so_pcb;
inp = (struct sctp_inpcb *)so->so_pcb;
- if (inp == 0) {
+ if (inp == NULL) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, ECONNRESET);
return (ECONNRESET); /* I made the same as TCP since we are
* not setup? */