diff options
author | tuexen <tuexen@FreeBSD.org> | 2014-08-22 20:22:12 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2014-08-22 20:22:12 +0000 |
commit | fcd4ba9eaabfa53f01ae9c54fc6bdbfd9a91ffa1 (patch) | |
tree | 904bcfbcd27fe0a0fe4516de4a6f7a06efa7effb /sys/netinet/sctputil.c | |
parent | 85630ed213a4dd53b8bb3a51a3824204c1eb417d (diff) | |
download | FreeBSD-src-fcd4ba9eaabfa53f01ae9c54fc6bdbfd9a91ffa1.zip FreeBSD-src-fcd4ba9eaabfa53f01ae9c54fc6bdbfd9a91ffa1.tar.gz |
MFC r269858:
Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED
socket options. Add also a sysctl to control the support of ASCONF.
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r-- | sys/netinet/sctputil.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 8c2ec48..d2a1f8f 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -906,6 +906,8 @@ 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->auth_supported = inp->auth_supported; + asoc->asconf_supported = inp->asconf_supported; asoc->reconfig_supported = inp->reconfig_supported; asoc->nrsack_supported = inp->nrsack_supported; asoc->pktdrop_supported = inp->pktdrop_supported; @@ -2622,17 +2624,17 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, if (notif_len > sizeof(struct sctp_assoc_change)) { if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { i = 0; - if (stcb->asoc.prsctp_supported) { + if (stcb->asoc.prsctp_supported == 1) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; } - if (stcb->asoc.peer_supports_auth) { + if (stcb->asoc.auth_supported == 1) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; } - if (stcb->asoc.peer_supports_asconf) { + if (stcb->asoc.asconf_supported == 1) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; } sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.reconfig_supported) { + if (stcb->asoc.reconfig_supported == 1) { sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; } sac->sac_length += i; @@ -3541,7 +3543,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) { sctp_notify_adaptation_layer(stcb); } - if (stcb->asoc.peer_supports_auth == 0) { + if (stcb->asoc.auth_supported == 0) { sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); } @@ -3615,7 +3617,7 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, break; case SCTP_NOTIFY_ASSOC_RESTART: sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 0, so_locked); - if (stcb->asoc.peer_supports_auth == 0) { + if (stcb->asoc.auth_supported == 0) { sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); } |