diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-12-09 14:19:03 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-10 09:53:34 +0100 |
commit | 75b706fde4cbf82bcd41a1cec319778aa0f8eb2d (patch) | |
tree | ea39a351a1f6337b5a5dd6036314693adef5ffe6 /freebsd/sys/netinet/sctp_usrreq.c | |
parent | VMSTAT(8): Port to RTEMS (diff) | |
download | rtems-libbsd-75b706fde4cbf82bcd41a1cec319778aa0f8eb2d.tar.bz2 |
Update to FreeBSD head 2016-12-10
Git mirror commit 80c55f08a05ab3b26a73b226ccb56adc3122a55c.
Diffstat (limited to 'freebsd/sys/netinet/sctp_usrreq.c')
-rw-r--r-- | freebsd/sys/netinet/sctp_usrreq.c | 142 |
1 files changed, 41 insertions, 101 deletions
diff --git a/freebsd/sys/netinet/sctp_usrreq.c b/freebsd/sys/netinet/sctp_usrreq.c index 1cbb7076..e3e398d4 100644 --- a/freebsd/sys/netinet/sctp_usrreq.c +++ b/freebsd/sys/netinet/sctp_usrreq.c @@ -137,7 +137,7 @@ sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint16_t nxtsz) chk->whoTo->flight_size, chk->book_size, (uint32_t) (uintptr_t) chk->whoTo, - chk->rec.data.TSN_seq); + chk->rec.data.tsn); } /* Clear any time so NO RTT is being done */ chk->do_rtt = 0; @@ -158,7 +158,6 @@ sctp_notify(struct sctp_inpcb *inp, { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; - #endif int timer_stopped; @@ -346,7 +345,6 @@ sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip) } return; } - #endif static int @@ -979,10 +977,8 @@ sctp_shutdown(struct socket *so) } } sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - /* - * XXX: Why do this in the case where we have still data - * queued? - */ + /* XXX: Why do this in the case where we have still data + * queued? */ sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CLOSING, SCTP_SO_LOCKED); SCTP_TCB_UNLOCK(stcb); SCTP_INP_RUNLOCK(inp); @@ -1023,14 +1019,11 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, struct sctp_ifa *sctp_ifa; size_t actual; int loopback_scope; - #if defined(INET) int ipv4_local_scope, ipv4_addr_legal; - #endif #if defined(INET6) int local_scope, site_scope, ipv6_addr_legal; - #endif struct sctp_vrf *vrf; @@ -1176,19 +1169,14 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, if (sin6->sin6_scope_id == 0) { if (sa6_recoverscope(sin6) != 0) /* - * + * * bad - * - * li - * nk - * - * loc - * al - * - * add - * re - * ss - * */ + * link + * + * local + * + * address + */ continue; } } @@ -1523,19 +1511,19 @@ out_now: stcb = LIST_FIRST(&inp->sctp_asoc_list); \ if (stcb) { \ SCTP_TCB_LOCK(stcb); \ - } \ + } \ SCTP_INP_RUNLOCK(inp); \ } else if (assoc_id > SCTP_ALL_ASSOC) { \ stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); \ if (stcb == NULL) { \ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); \ + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); \ error = ENOENT; \ break; \ } \ } else { \ stcb = NULL; \ - } \ - } + } \ +} #define SCTP_CHECK_AND_CAST(destp, srcp, type, size) {\ @@ -1546,7 +1534,7 @@ out_now: } else { \ destp = (type *)srcp; \ } \ - } +} static int sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize, @@ -1825,10 +1813,8 @@ flags_out: } SCTP_TCB_UNLOCK(stcb); } else { - /* - * Can't get stream value without - * association - */ + /* Can't get stream value without + * association */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } @@ -2328,10 +2314,8 @@ flags_out: struct sctp_paddrparams *paddrp; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, *optsize); @@ -2531,10 +2515,8 @@ flags_out: struct sctp_paddrinfo *paddri; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(paddri, optval, struct sctp_paddrinfo, *optsize); @@ -3200,10 +3182,8 @@ flags_out: struct sctp_paddrthlds *thlds; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, *optsize); @@ -3314,10 +3294,8 @@ flags_out: struct sctp_udpencaps *encaps; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); @@ -3911,12 +3889,10 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_INTERLEAVE_STRMS))) { inp->idata_supported = 1; } else { - /* - * Must have Frag + /* Must have Frag * interleave and * stream interleave - * on - */ + * on */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } @@ -4127,10 +4103,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } SCTP_INP_RUNLOCK(inp); } else { - /* - * Can't set stream value without - * association - */ + /* Can't set stream value without + * association */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } @@ -4360,10 +4334,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); shared_keys = &stcb->asoc.shared_keys; - /* - * clear the cached keys for - * this key id - */ + /* clear the cached keys for + * this key id */ sctp_clear_cachedkeys(stcb, sca->sca_keynumber); /* * create the new shared key @@ -4762,10 +4734,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, int cnt; addstream |= 2; - /* - * We allocate inside - * sctp_send_str_reset_req() - */ + /* We allocate inside + * sctp_send_str_reset_req() */ add_i_strmcnt = stradd->sas_instrms; cnt = add_i_strmcnt; cnt += stcb->asoc.streamincnt; @@ -4813,10 +4783,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_TCB_UNLOCK(stcb); break; } - /* - * Is there any data pending in the send or sent - * queues? - */ + /* Is there any data pending in the send or sent + * queues? */ if (!TAILQ_EMPTY(&stcb->asoc.send_queue) || !TAILQ_EMPTY(&stcb->asoc.sent_queue)) { busy_out: @@ -4962,10 +4930,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) || (av->assoc_id == SCTP_FUTURE_ASSOC)) { SCTP_INP_WLOCK(inp); - /* - * FIXME MT: I think this is not in - * tune with the API ID - */ + /* FIXME MT: I think this is not in + * tune with the API ID */ if (av->assoc_value) { inp->sctp_frag_point = (av->assoc_value + ovh); } else { @@ -5108,10 +5074,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } SCTP_TCB_UNLOCK(stcb); } - /* - * Send up the sender dry event only for 1-to-1 - * style sockets. - */ + /* Send up the sender dry event only for 1-to-1 + * style sockets. */ if (events->sctp_sender_dry_event) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { @@ -5197,10 +5161,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, struct sctp_paddrparams *paddrp; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, optsize); @@ -5701,10 +5663,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, struct sctp_setprim *spa; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(spa, optval, struct sctp_setprim, optsize); @@ -5793,10 +5753,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, { struct sctp_setpeerprim *sspp; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(sspp, optval, struct sctp_setpeerprim, optsize); @@ -5828,10 +5786,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, goto out_of_it; } if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) { - /* - * Must validate the ifa found is in - * our ep - */ + /* Must validate the ifa found is in + * our ep */ struct sctp_laddr *laddr; int found = 0; @@ -6246,10 +6202,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, struct sctp_paddrthlds *thlds; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, optsize); @@ -6417,10 +6371,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, struct sctp_udpencaps *encaps; struct sctp_nets *net; struct sockaddr *addr; - #if defined(INET) && defined(INET6) struct sockaddr_in sin_store; - #endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); @@ -6591,10 +6543,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, (av->assoc_id == SCTP_FUTURE_ASSOC)) { if ((av->assoc_value == 0) && (inp->asconf_supported == 1)) { - /* - * AUTH is required for - * ASCONF - */ + /* AUTH is required for + * ASCONF */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { @@ -6630,10 +6580,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, (av->assoc_id == SCTP_FUTURE_ASSOC)) { if ((av->assoc_value != 0) && (inp->auth_supported == 0)) { - /* - * AUTH is required for - * ASCONF - */ + /* AUTH is required for + * ASCONF */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { @@ -7012,7 +6960,6 @@ out_now: SCTP_INP_DECR_REF(inp); return (error); } - #endif int @@ -7066,10 +7013,8 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && (tinp->sctp_socket->so_qlimit)) { - /* - * we have a listener already and - * its not this inp. - */ + /* we have a listener already and + * its not this inp. */ SCTP_INP_DECR_REF(tinp); return (EADDRINUSE); } else if (tinp) { @@ -7110,10 +7055,8 @@ sctp_listen(struct socket *so, int backlog, struct thread *p) ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) && ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && (tinp->sctp_socket->so_qlimit)) { - /* - * we have a listener already and its not - * this inp. - */ + /* we have a listener already and its not + * this inp. */ SCTP_INP_DECR_REF(tinp); return (EADDRINUSE); } else if (tinp) { @@ -7186,10 +7129,8 @@ sctp_accept(struct socket *so, struct sockaddr **addr) struct sctp_tcb *stcb; struct sctp_inpcb *inp; union sctp_sockstore store; - #ifdef INET6 int error; - #endif inp = (struct sctp_inpcb *)so->so_pcb; @@ -7472,5 +7413,4 @@ struct pr_usrreqs sctp_usrreqs = { .pru_sosend = sctp_sosend, .pru_soreceive = sctp_soreceive }; - #endif |