提交 0ef46e28 编写于 作者: V Vlad Yasevich 提交者: David S. Miller

sctp: do not enable peer features if we can't do them.

Do not enable peer features like addip and auth, if they
are administratively disabled localy.  If the peer resports
that he supports something that we don't, neither end can
use it so enabling it is pointless.  This solves a problem
when talking to a peer that has auth and addip enabled while
we do not.  Found by Andrei Pelinescu-Onciul <andrei@iptel.org>.
Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a3028b8e
...@@ -1886,10 +1886,12 @@ static void sctp_process_ext_param(struct sctp_association *asoc, ...@@ -1886,10 +1886,12 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
/* if the peer reports AUTH, assume that he /* if the peer reports AUTH, assume that he
* supports AUTH. * supports AUTH.
*/ */
if (sctp_auth_enable)
asoc->peer.auth_capable = 1; asoc->peer.auth_capable = 1;
break; break;
case SCTP_CID_ASCONF: case SCTP_CID_ASCONF:
case SCTP_CID_ASCONF_ACK: case SCTP_CID_ASCONF_ACK:
if (sctp_addip_enable)
asoc->peer.asconf_capable = 1; asoc->peer.asconf_capable = 1;
break; break;
default: default:
...@@ -2460,6 +2462,9 @@ static int sctp_process_param(struct sctp_association *asoc, ...@@ -2460,6 +2462,9 @@ static int sctp_process_param(struct sctp_association *asoc,
break; break;
case SCTP_PARAM_SET_PRIMARY: case SCTP_PARAM_SET_PRIMARY:
if (!sctp_addip_enable)
goto fall_through;
addr_param = param.v + sizeof(sctp_addip_param_t); addr_param = param.v + sizeof(sctp_addip_param_t);
af = sctp_get_af_specific(param_type2af(param.p->type)); af = sctp_get_af_specific(param_type2af(param.p->type));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册