Deleted Added
full compact
sctp_usrreq.c (171440) sctp_usrreq.c (171477)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_usrreq.c,v 1.48 2005/03/07 23:26:08 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 171440 2007-07-14 09:36:28Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 171477 2007-07-17 20:58:26Z rrs $");
35#include <netinet/sctp_os.h>
36#include <sys/proc.h>
37#include <netinet/sctp_pcb.h>
38#include <netinet/sctp_header.h>
39#include <netinet/sctp_var.h>
40#if defined(INET6)
41#include <netinet6/sctp6_var.h>
42#endif

--- 229 unchanged lines hidden (view full) ---

272 * state, also set the destination to the PF
273 * state.
274 */
275 /*
276 * Add debug message here if destination is
277 * not in PF state.
278 */
279 /* Stop any running T3 timers here? */
35#include <netinet/sctp_os.h>
36#include <sys/proc.h>
37#include <netinet/sctp_pcb.h>
38#include <netinet/sctp_header.h>
39#include <netinet/sctp_var.h>
40#if defined(INET6)
41#include <netinet6/sctp6_var.h>
42#endif

--- 229 unchanged lines hidden (view full) ---

272 * state, also set the destination to the PF
273 * state.
274 */
275 /*
276 * Add debug message here if destination is
277 * not in PF state.
278 */
279 /* Stop any running T3 timers here? */
280 if (sctp_cmt_pf) {
280 if (sctp_cmt_on_off && sctp_cmt_pf) {
281 net->dest_state &= ~SCTP_ADDR_PF;
282 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
283 net);
284 }
285 net->error_count = net->failure_threshold + 1;
286 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN,
287 stcb, SCTP_FAILED_THRESHOLD,
288 (void *)net);

--- 279 unchanged lines hidden (view full) ---

568#endif /* INET6 */
569 if (addr && (addr->sa_len != sizeof(struct sockaddr_in))) {
570 return EINVAL;
571 }
572 inp = (struct sctp_inpcb *)so->so_pcb;
573 if (inp == 0)
574 return EINVAL;
575
281 net->dest_state &= ~SCTP_ADDR_PF;
282 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n",
283 net);
284 }
285 net->error_count = net->failure_threshold + 1;
286 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN,
287 stcb, SCTP_FAILED_THRESHOLD,
288 (void *)net);

--- 279 unchanged lines hidden (view full) ---

568#endif /* INET6 */
569 if (addr && (addr->sa_len != sizeof(struct sockaddr_in))) {
570 return EINVAL;
571 }
572 inp = (struct sctp_inpcb *)so->so_pcb;
573 if (inp == 0)
574 return EINVAL;
575
576 error = sctp_inpcb_bind(so, addr, NULL, p);
576 error = sctp_inpcb_bind(so, addr, p);
577 return error;
578}
579
580static void
581sctp_close(struct socket *so)
582{
583 struct sctp_inpcb *inp;
584 uint32_t flags;

--- 755 unchanged lines hidden (view full) ---

1340 error = EINVAL;
1341 goto out_now;
1342 }
1343 }
1344#endif /* INET6 */
1345 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
1346 SCTP_PCB_FLAGS_UNBOUND) {
1347 /* Bind a ephemeral port */
577 return error;
578}
579
580static void
581sctp_close(struct socket *so)
582{
583 struct sctp_inpcb *inp;
584 uint32_t flags;

--- 755 unchanged lines hidden (view full) ---

1340 error = EINVAL;
1341 goto out_now;
1342 }
1343 }
1344#endif /* INET6 */
1345 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
1346 SCTP_PCB_FLAGS_UNBOUND) {
1347 /* Bind a ephemeral port */
1348 error = sctp_inpcb_bind(so, NULL, NULL, p);
1348 error = sctp_inpcb_bind(so, NULL, p);
1349 if (error) {
1350 goto out_now;
1351 }
1352 }
1353 /* FIX ME: do we want to pass in a vrf on the connect call? */
1354 vrf_id = inp->def_vrf_id;
1355
1356 /* We are GOOD to go */

--- 849 unchanged lines hidden (view full) ---

2206 SCTP_INP_RUNLOCK(inp);
2207 }
2208 *optsize = sizeof(*srto);
2209 }
2210 break;
2211 case SCTP_ASSOCINFO:
2212 {
2213 struct sctp_assocparams *sasoc;
1349 if (error) {
1350 goto out_now;
1351 }
1352 }
1353 /* FIX ME: do we want to pass in a vrf on the connect call? */
1354 vrf_id = inp->def_vrf_id;
1355
1356 /* We are GOOD to go */

--- 849 unchanged lines hidden (view full) ---

2206 SCTP_INP_RUNLOCK(inp);
2207 }
2208 *optsize = sizeof(*srto);
2209 }
2210 break;
2211 case SCTP_ASSOCINFO:
2212 {
2213 struct sctp_assocparams *sasoc;
2214 uint32_t oldval;
2214
2215 SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, *optsize);
2216 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
2217
2218 if (stcb) {
2215
2216 SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, *optsize);
2217 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
2218
2219 if (stcb) {
2220 oldval = sasoc->sasoc_cookie_life;
2221 sasoc->sasoc_cookie_life = TICKS_TO_MSEC(stcb->asoc.cookie_life);
2219 sasoc->sasoc_asocmaxrxt = stcb->asoc.max_send_times;
2220 sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
2221 sasoc->sasoc_peer_rwnd = stcb->asoc.peers_rwnd;
2222 sasoc->sasoc_local_rwnd = stcb->asoc.my_rwnd;
2222 sasoc->sasoc_asocmaxrxt = stcb->asoc.max_send_times;
2223 sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
2224 sasoc->sasoc_peer_rwnd = stcb->asoc.peers_rwnd;
2225 sasoc->sasoc_local_rwnd = stcb->asoc.my_rwnd;
2223 sasoc->sasoc_cookie_life = TICKS_TO_MSEC(stcb->asoc.cookie_life);
2224 SCTP_TCB_UNLOCK(stcb);
2225 } else {
2226 SCTP_INP_RLOCK(inp);
2226 SCTP_TCB_UNLOCK(stcb);
2227 } else {
2228 SCTP_INP_RLOCK(inp);
2229 sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life);
2227 sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
2228 sasoc->sasoc_number_peer_destinations = 0;
2229 sasoc->sasoc_peer_rwnd = 0;
2230 sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
2230 sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
2231 sasoc->sasoc_number_peer_destinations = 0;
2232 sasoc->sasoc_peer_rwnd = 0;
2233 sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
2231 sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life);
2232 SCTP_INP_RUNLOCK(inp);
2233 }
2234 *optsize = sizeof(*sasoc);
2235 }
2236 break;
2237 case SCTP_DEFAULT_SEND_PARAM:
2238 {
2239 struct sctp_sndrcvinfo *s_info;

--- 438 unchanged lines hidden (view full) ---

2678 break;
2679 }
2680 case SCTP_DELAYED_SACK:
2681 {
2682 struct sctp_sack_info *sack;
2683
2684 SCTP_CHECK_AND_CAST(sack, optval, struct sctp_sack_info, optsize);
2685 SCTP_FIND_STCB(inp, stcb, sack->sack_assoc_id);
2234 SCTP_INP_RUNLOCK(inp);
2235 }
2236 *optsize = sizeof(*sasoc);
2237 }
2238 break;
2239 case SCTP_DEFAULT_SEND_PARAM:
2240 {
2241 struct sctp_sndrcvinfo *s_info;

--- 438 unchanged lines hidden (view full) ---

2680 break;
2681 }
2682 case SCTP_DELAYED_SACK:
2683 {
2684 struct sctp_sack_info *sack;
2685
2686 SCTP_CHECK_AND_CAST(sack, optval, struct sctp_sack_info, optsize);
2687 SCTP_FIND_STCB(inp, stcb, sack->sack_assoc_id);
2688 if (sack->sack_delay) {
2689 if (sack->sack_delay > SCTP_MAX_SACK_DELAY)
2690 sack->sack_delay = SCTP_MAX_SACK_DELAY;
2691 }
2686 if (stcb) {
2687 if (sack->sack_delay) {
2688 if (MSEC_TO_TICKS(sack->sack_delay) < 1) {
2689 sack->sack_delay = TICKS_TO_MSEC(1);
2690 }
2691 stcb->asoc.delayed_ack = sack->sack_delay;
2692 }
2693 if (sack->sack_freq) {

--- 682 unchanged lines hidden (view full) ---

3376 * For the TOS/FLOWLABEL stuff you set it
3377 * with the options on the socket
3378 */
3379 if (paddrp->spp_pathmaxrxt) {
3380 inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
3381 }
3382 if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO)
3383 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
2692 if (stcb) {
2693 if (sack->sack_delay) {
2694 if (MSEC_TO_TICKS(sack->sack_delay) < 1) {
2695 sack->sack_delay = TICKS_TO_MSEC(1);
2696 }
2697 stcb->asoc.delayed_ack = sack->sack_delay;
2698 }
2699 if (sack->sack_freq) {

--- 682 unchanged lines hidden (view full) ---

3382 * For the TOS/FLOWLABEL stuff you set it
3383 * with the options on the socket
3384 */
3385 if (paddrp->spp_pathmaxrxt) {
3386 inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
3387 }
3388 if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO)
3389 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
3384 else if (paddrp->spp_hbinterval)
3390 else if (paddrp->spp_hbinterval) {
3391 if (paddrp->spp_hbinterval > SCTP_MAX_HB_INTERVAL)
3392 paddrp->spp_hbinterval = SCTP_MAX_HB_INTERVAL;
3385 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
3393 inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
3386
3394 }
3387 if (paddrp->spp_flags & SPP_HB_ENABLE) {
3388 sctp_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
3389
3390 } else if (paddrp->spp_flags & SPP_HB_DISABLE) {
3391 sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
3392 }
3393 SCTP_INP_WUNLOCK(inp);
3394 }

--- 54 unchanged lines hidden (view full) ---

3449 }
3450 break;
3451 case SCTP_ASSOCINFO:
3452 {
3453 struct sctp_assocparams *sasoc;
3454
3455 SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, optsize);
3456 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
3395 if (paddrp->spp_flags & SPP_HB_ENABLE) {
3396 sctp_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
3397
3398 } else if (paddrp->spp_flags & SPP_HB_DISABLE) {
3399 sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
3400 }
3401 SCTP_INP_WUNLOCK(inp);
3402 }

--- 54 unchanged lines hidden (view full) ---

3457 }
3458 break;
3459 case SCTP_ASSOCINFO:
3460 {
3461 struct sctp_assocparams *sasoc;
3462
3463 SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, optsize);
3464 SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
3457
3465 if (sasoc->sasoc_cookie_life) {
3466 /* boundary check the cookie life */
3467 if (sasoc->sasoc_cookie_life < 1000)
3468 sasoc->sasoc_cookie_life = 1000;
3469 if (sasoc->sasoc_cookie_life > SCTP_MAX_COOKIE_LIFE) {
3470 sasoc->sasoc_cookie_life = SCTP_MAX_COOKIE_LIFE;
3471 }
3472 }
3458 if (stcb) {
3459 if (sasoc->sasoc_asocmaxrxt)
3460 stcb->asoc.max_send_times = sasoc->sasoc_asocmaxrxt;
3461 sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
3462 sasoc->sasoc_peer_rwnd = 0;
3463 sasoc->sasoc_local_rwnd = 0;
3464 if (sasoc->sasoc_cookie_life) {
3473 if (stcb) {
3474 if (sasoc->sasoc_asocmaxrxt)
3475 stcb->asoc.max_send_times = sasoc->sasoc_asocmaxrxt;
3476 sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
3477 sasoc->sasoc_peer_rwnd = 0;
3478 sasoc->sasoc_local_rwnd = 0;
3479 if (sasoc->sasoc_cookie_life) {
3465 if (sasoc->sasoc_cookie_life < 1000)
3466 sasoc->sasoc_cookie_life = 1000;
3467 stcb->asoc.cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
3480 stcb->asoc.cookie_life = sasoc->sasoc_cookie_life;
3481
3468 }
3469 SCTP_TCB_UNLOCK(stcb);
3470 } else {
3471 SCTP_INP_WLOCK(inp);
3472 if (sasoc->sasoc_asocmaxrxt)
3473 inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
3474 sasoc->sasoc_number_peer_destinations = 0;
3475 sasoc->sasoc_peer_rwnd = 0;
3476 sasoc->sasoc_local_rwnd = 0;
3477 if (sasoc->sasoc_cookie_life) {
3482 }
3483 SCTP_TCB_UNLOCK(stcb);
3484 } else {
3485 SCTP_INP_WLOCK(inp);
3486 if (sasoc->sasoc_asocmaxrxt)
3487 inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
3488 sasoc->sasoc_number_peer_destinations = 0;
3489 sasoc->sasoc_peer_rwnd = 0;
3490 sasoc->sasoc_local_rwnd = 0;
3491 if (sasoc->sasoc_cookie_life) {
3478 if (sasoc->sasoc_cookie_life < 1000)
3479 sasoc->sasoc_cookie_life = 1000;
3480 inp->sctp_ep.def_cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
3481 }
3482 SCTP_INP_WUNLOCK(inp);
3483 }
3484 }
3485 break;
3486 case SCTP_INITMSG:
3487 {

--- 126 unchanged lines hidden (view full) ---

3614 error = EINVAL;
3615 }
3616
3617 }
3618 break;
3619 case SCTP_BINDX_ADD_ADDR:
3620 {
3621 struct sctp_getaddresses *addrs;
3492 inp->sctp_ep.def_cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
3493 }
3494 SCTP_INP_WUNLOCK(inp);
3495 }
3496 }
3497 break;
3498 case SCTP_INITMSG:
3499 {

--- 126 unchanged lines hidden (view full) ---

3626 error = EINVAL;
3627 }
3628
3629 }
3630 break;
3631 case SCTP_BINDX_ADD_ADDR:
3632 {
3633 struct sctp_getaddresses *addrs;
3634 int sz;
3635 struct thread *td;
3636 int prison = 0;
3622
3637
3638 td = (struct thread *)p;
3639 if (jailed(td->td_ucred)) {
3640 prison = 1;
3641 }
3623 SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses,
3624 optsize);
3642 SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses,
3643 optsize);
3644 if (addrs->addr->sa_family == AF_INET) {
3645 sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in);
3646 if (optsize < sz) {
3647 error = EINVAL;
3648 break;
3649 }
3650 if (prison && prison_ip(td->td_ucred, 0, &(((struct sockaddr_in *)(addrs->addr))->sin_addr.s_addr))) {
3651 error = EADDRNOTAVAIL;
3652 }
3653 } else if (addrs->addr->sa_family == AF_INET6) {
3654 sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6);
3655 if (optsize < sz) {
3656 error = EINVAL;
3657 break;
3658 }
3659 /* JAIL XXXX Add else here for V6 */
3660 }
3625 sctp_bindx_add_address(so, inp, addrs->addr,
3626 addrs->sget_assoc_id, vrf_id,
3627 &error, p);
3628 }
3629 break;
3630 case SCTP_BINDX_REM_ADDR:
3631 {
3632 struct sctp_getaddresses *addrs;
3661 sctp_bindx_add_address(so, inp, addrs->addr,
3662 addrs->sget_assoc_id, vrf_id,
3663 &error, p);
3664 }
3665 break;
3666 case SCTP_BINDX_REM_ADDR:
3667 {
3668 struct sctp_getaddresses *addrs;
3669 int sz;
3670 struct thread *td;
3671 int prison = 0;
3633
3672
3673 td = (struct thread *)p;
3674 if (jailed(td->td_ucred)) {
3675 prison = 1;
3676 }
3634 SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize);
3677 SCTP_CHECK_AND_CAST(addrs, optval, struct sctp_getaddresses, optsize);
3678 if (addrs->addr->sa_family == AF_INET) {
3679 sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in);
3680 if (optsize < sz) {
3681 error = EINVAL;
3682 break;
3683 }
3684 if (prison && prison_ip(td->td_ucred, 0, &(((struct sockaddr_in *)(addrs->addr))->sin_addr.s_addr))) {
3685 error = EADDRNOTAVAIL;
3686 }
3687 } else if (addrs->addr->sa_family == AF_INET6) {
3688 sz = sizeof(struct sctp_getaddresses) - sizeof(struct sockaddr) + sizeof(struct sockaddr_in6);
3689 if (optsize < sz) {
3690 error = EINVAL;
3691 break;
3692 }
3693 /* JAIL XXXX Add else here for V6 */
3694 }
3635 sctp_bindx_delete_address(so, inp, addrs->addr,
3636 addrs->sget_assoc_id, vrf_id,
3637 &error);
3638 }
3639 break;
3640 default:
3641 error = ENOPROTOOPT;
3642 break;

--- 95 unchanged lines hidden (view full) ---

3738 (addr->sa_family == AF_INET6)) {
3739 error = EINVAL;
3740 goto out_now;
3741 }
3742#endif /* INET6 */
3743 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
3744 SCTP_PCB_FLAGS_UNBOUND) {
3745 /* Bind a ephemeral port */
3695 sctp_bindx_delete_address(so, inp, addrs->addr,
3696 addrs->sget_assoc_id, vrf_id,
3697 &error);
3698 }
3699 break;
3700 default:
3701 error = ENOPROTOOPT;
3702 break;

--- 95 unchanged lines hidden (view full) ---

3798 (addr->sa_family == AF_INET6)) {
3799 error = EINVAL;
3800 goto out_now;
3801 }
3802#endif /* INET6 */
3803 if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) ==
3804 SCTP_PCB_FLAGS_UNBOUND) {
3805 /* Bind a ephemeral port */
3746 error = sctp_inpcb_bind(so, NULL, NULL, p);
3806 error = sctp_inpcb_bind(so, NULL, p);
3747 if (error) {
3748 goto out_now;
3749 }
3750 }
3751 /* Now do we connect? */
3752 if (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) {
3753 error = EINVAL;
3754 goto out_now;

--- 94 unchanged lines hidden (view full) ---

3849 SCTP_INP_RUNLOCK(inp);
3850 SOCK_UNLOCK(so);
3851 return (EADDRINUSE);
3852 }
3853 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
3854 /* We must do a bind. */
3855 SOCK_UNLOCK(so);
3856 SCTP_INP_RUNLOCK(inp);
3807 if (error) {
3808 goto out_now;
3809 }
3810 }
3811 /* Now do we connect? */
3812 if (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL) {
3813 error = EINVAL;
3814 goto out_now;

--- 94 unchanged lines hidden (view full) ---

3909 SCTP_INP_RUNLOCK(inp);
3910 SOCK_UNLOCK(so);
3911 return (EADDRINUSE);
3912 }
3913 if (inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) {
3914 /* We must do a bind. */
3915 SOCK_UNLOCK(so);
3916 SCTP_INP_RUNLOCK(inp);
3857 if ((error = sctp_inpcb_bind(so, NULL, NULL, p))) {
3917 if ((error = sctp_inpcb_bind(so, NULL, p))) {
3858 /* bind error, probably perm */
3859 return (error);
3860 }
3861 SOCK_LOCK(so);
3862 } else {
3863 SCTP_INP_RUNLOCK(inp);
3864 }
3865 /* It appears for 7.0 and on, we must always call this. */

--- 272 unchanged lines hidden ---
3918 /* bind error, probably perm */
3919 return (error);
3920 }
3921 SOCK_LOCK(so);
3922 } else {
3923 SCTP_INP_RUNLOCK(inp);
3924 }
3925 /* It appears for 7.0 and on, we must always call this. */

--- 272 unchanged lines hidden ---