aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@fh-muenster.de>2020-05-18 21:50:12 +0200
committerMichael Tuexen <tuexen@fh-muenster.de>2020-05-18 21:50:12 +0200
commitc6c994c79bfddc8c58306bed20e3f15343eecea0 (patch)
tree000454743e21c18722275b47b0fb9a09a1622857
parent4be8f82ebf49fdd87b03b5fb39d0bcb562e1f812 (diff)
downloadusrsctp-c6c994c79bfddc8c58306bed20e3f15343eecea0.tar.gz
Cleanups.
-rwxr-xr-xusrsctplib/netinet/sctp_asconf.c12
-rwxr-xr-xusrsctplib/netinet/sctp_auth.c3
-rwxr-xr-xusrsctplib/netinet/sctp_os_userspace.h1
-rwxr-xr-xusrsctplib/netinet/sctp_pcb.c8
-rwxr-xr-xusrsctplib/netinet/sctp_usrreq.c10
-rwxr-xr-xusrsctplib/netinet/sctputil.c3
6 files changed, 12 insertions, 25 deletions
diff --git a/usrsctplib/netinet/sctp_asconf.c b/usrsctplib/netinet/sctp_asconf.c
index c512628d..782d0916 100755
--- a/usrsctplib/netinet/sctp_asconf.c
+++ b/usrsctplib/netinet/sctp_asconf.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 361209 2020-05-18 10:07:01Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_asconf.c 361222 2020-05-18 18:32:58Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -1834,9 +1834,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
} /* switch */
/* update remaining ASCONF-ACK message length to process */
- ack_length -= SCTP_SIZE32(param_length);
- if (ack_length <= 0) {
- /* no more data in the mbuf chain */
+ if (ack_length > SCTP_SIZE32(param_length)) {
+ ack_length -= SCTP_SIZE32(param_length);
+ } else {
break;
}
offset += SCTP_SIZE32(param_length);
@@ -3077,10 +3077,6 @@ sctp_check_address_list_ep(struct sctp_tcb *stcb, struct mbuf *m, int offset,
"check_addr_list_ep: laddr->ifa is NULL");
continue;
}
- if (laddr->ifa == NULL) {
- SCTPDBG(SCTP_DEBUG_ASCONF1, "check_addr_list_ep: laddr->ifa->ifa_addr is NULL");
- continue;
- }
/* do i have it implicitly? */
if (sctp_cmpaddr(&laddr->ifa->address.sa, init_addr)) {
continue;
diff --git a/usrsctplib/netinet/sctp_auth.c b/usrsctplib/netinet/sctp_auth.c
index 640858b9..ba655159 100755
--- a/usrsctplib/netinet/sctp_auth.c
+++ b/usrsctplib/netinet/sctp_auth.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 355931 2019-12-20 15:25:08Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 361227 2020-05-18 19:48:38Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -660,7 +660,6 @@ sctp_free_hmaclist(sctp_hmaclist_t *list)
{
if (list != NULL) {
SCTP_FREE(list,SCTP_M_AUTH_HL);
- list = NULL;
}
}
diff --git a/usrsctplib/netinet/sctp_os_userspace.h b/usrsctplib/netinet/sctp_os_userspace.h
index 784a573d..3524a26d 100755
--- a/usrsctplib/netinet/sctp_os_userspace.h
+++ b/usrsctplib/netinet/sctp_os_userspace.h
@@ -888,7 +888,6 @@ static inline void sctp_userspace_rtfree(sctp_rtentry_t *rt)
return;
}
free(rt);
- rt = NULL;
}
#define rtfree(arg1) sctp_userspace_rtfree(arg1)
diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c
index 36fbb55b..ea0d7e55 100755
--- a/usrsctplib/netinet/sctp_pcb.c
+++ b/usrsctplib/netinet/sctp_pcb.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 361209 2020-05-18 10:07:01Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 361224 2020-05-18 18:42:43Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -6004,16 +6004,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre
SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE,
SCTP_CALLED_DIRECTLY_NOCMPSET);
SCTP_INP_DECR_REF(inp);
- goto out_of;
} else {
/* The socket is still open. */
SCTP_INP_DECR_REF(inp);
+ SCTP_INP_RUNLOCK(inp);
}
}
- if (from_inpcbfree == SCTP_NORMAL_PROC) {
- SCTP_INP_RUNLOCK(inp);
- }
- out_of:
/* destroyed the asoc */
#ifdef SCTP_LOG_CLOSING
sctp_log_closing(inp, NULL, 11);
diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c
index d71f9e26..708dad0b 100755
--- a/usrsctplib/netinet/sctp_usrreq.c
+++ b/usrsctplib/netinet/sctp_usrreq.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 359410 2020-03-28 22:35:04Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 361226 2020-05-18 19:35:46Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -1534,7 +1534,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp,
struct sctp_vrf *vrf;
actual = 0;
- if (limit <= 0)
+ if (limit == 0)
return (actual);
if (stcb) {
@@ -8566,9 +8566,9 @@ sctp_accept(struct socket *so, struct sockaddr **addr)
struct sctp_inpcb *inp;
union sctp_sockstore store;
#ifdef INET6
-#ifdef SCTP_KAME
+#if defined(SCTP_KAME) && defined(SCTP_EMBEDDED_V6_SCOPE)
int error;
-#endif /* SCTP_KAME */
+#endif
#endif
inp = (struct sctp_inpcb *)so->so_pcb;
@@ -9034,8 +9034,6 @@ sctp_usrreq(so, req, m, nam, control)
struct mbuf *m, *nam, *control;
{
struct proc *p = curproc;
- uint32_t vrf_id;
- struct sctp_vrf *vrf;
int error;
int family;
struct sctp_inpcb *inp = (struct sctp_inpcb *)so->so_pcb;
diff --git a/usrsctplib/netinet/sctputil.c b/usrsctplib/netinet/sctputil.c
index d299ba69..8d81893b 100755
--- a/usrsctplib/netinet/sctputil.c
+++ b/usrsctplib/netinet/sctputil.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 361214 2020-05-18 15:02:15Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 361225 2020-05-18 19:23:01Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -1180,7 +1180,6 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off;
asoc->ecn_supported = inp->ecn_supported;
asoc->prsctp_supported = inp->prsctp_supported;
- asoc->idata_supported = inp->idata_supported;
asoc->auth_supported = inp->auth_supported;
asoc->asconf_supported = inp->asconf_supported;
asoc->reconfig_supported = inp->reconfig_supported;