summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_timer.c')
-rw-r--r--sys/netinet/sctp_timer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index e2bd5bb..1e0b771 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -482,6 +482,9 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
if (mnet == NULL) {
mnet = TAILQ_FIRST(&stcb->asoc.nets);
+ if (mnet == NULL) {
+ return (NULL);
+ }
}
do {
alt = TAILQ_NEXT(mnet, sctp_next);
@@ -491,6 +494,9 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
break;
}
alt = TAILQ_FIRST(&stcb->asoc.nets);
+ if (alt == NULL) {
+ return (NULL);
+ }
}
if (alt->ro.ro_rt == NULL) {
if (alt->ro._s_addr) {
@@ -517,6 +523,9 @@ sctp_find_alternate_net(struct sctp_tcb *stcb,
once = 0;
mnet = net;
do {
+ if (mnet == NULL) {
+ return (TAILQ_FIRST(&stcb->asoc.nets));
+ }
alt = TAILQ_NEXT(mnet, sctp_next);
if (alt == NULL) {
once++;
OpenPOWER on IntegriCloud