diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-09-16 22:35:39 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:33 -0400 |
commit | 6b2f9cb64db2d2460da17900bf54266030cc24f1 (patch) | |
tree | 1aa95cba41e7dc9071fe1773a567822b60d71f35 /net/sctp/sm_make_chunk.c | |
parent | 65b07e5d0d09c77e98050b5f0146ead29e5add32 (diff) |
[SCTP]: Tie ADD-IP and AUTH functionality as required by spec.
ADD-IP spec requires AUTH. It is, in fact, dangerous without AUTH.
So, disable ADD-IP functionality if the peer claims to support
ADD-IP, but not AUTH.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index fa2ba543183d..f983a369d4e2 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1851,7 +1851,8 @@ static void sctp_process_ext_param(struct sctp_association *asoc, | |||
1851 | break; | 1851 | break; |
1852 | case SCTP_CID_ASCONF: | 1852 | case SCTP_CID_ASCONF: |
1853 | case SCTP_CID_ASCONF_ACK: | 1853 | case SCTP_CID_ASCONF_ACK: |
1854 | /* don't need to do anything for ASCONF */ | 1854 | asoc->peer.addip_capable = 1; |
1855 | break; | ||
1855 | default: | 1856 | default: |
1856 | break; | 1857 | break; |
1857 | } | 1858 | } |
@@ -2137,6 +2138,16 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid, | |||
2137 | !asoc->peer.peer_hmacs)) | 2138 | !asoc->peer.peer_hmacs)) |
2138 | asoc->peer.auth_capable = 0; | 2139 | asoc->peer.auth_capable = 0; |
2139 | 2140 | ||
2141 | |||
2142 | /* If the peer claims support for ADD-IP without support | ||
2143 | * for AUTH, disable support for ADD-IP. | ||
2144 | */ | ||
2145 | if (asoc->peer.addip_capable && !asoc->peer.auth_capable) { | ||
2146 | asoc->peer.addip_disabled_mask |= (SCTP_PARAM_ADD_IP | | ||
2147 | SCTP_PARAM_DEL_IP | | ||
2148 | SCTP_PARAM_SET_PRIMARY); | ||
2149 | } | ||
2150 | |||
2140 | /* Walk list of transports, removing transports in the UNKNOWN state. */ | 2151 | /* Walk list of transports, removing transports in the UNKNOWN state. */ |
2141 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { | 2152 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { |
2142 | transport = list_entry(pos, struct sctp_transport, transports); | 2153 | transport = list_entry(pos, struct sctp_transport, transports); |