sctp: remove prsctp_enable from asoc
authorXin Long <lucien.xin@gmail.com>
Mon, 8 Jul 2019 16:57:05 +0000 (00:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jul 2019 03:16:24 +0000 (20:16 -0700)
Like reconf_enable, prsctp_enable should also be removed from asoc,
as asoc->peer.prsctp_capable has taken its job.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/associola.c
net/sctp/sm_make_chunk.c
net/sctp/socket.c

index d9e0e1a53f996a318d8c1042bc81b82725bb8429..7f35b8ee9f65eb28528d7da04790614dc5e25efd 100644 (file)
@@ -2050,8 +2050,7 @@ struct sctp_association {
        __u8 need_ecne:1,       /* Need to send an ECNE Chunk? */
             temp:1,            /* Is it a temporary association? */
             force_delay:1,
-            intl_enable:1,
-            prsctp_enable:1;
+            intl_enable:1;
 
        __u8 strreset_enable;
        __u8 strreset_outstanding; /* request param count on the fly */
index 321c199edacfd3533fbe08a270797aa6ef48c07b..5010cce52c9359ee9ab0a163900c017edbe41fdf 100644 (file)
@@ -261,7 +261,6 @@ static struct sctp_association *sctp_association_init(
                goto stream_free;
 
        asoc->active_key_id = ep->active_key_id;
-       asoc->prsctp_enable = ep->prsctp_enable;
        asoc->strreset_enable = ep->strreset_enable;
 
        /* Save the hmacs and chunks list into this association */
index d784dc176d703b76d0f864deed9d4b08b207d357..227bbac5222f392a75d2d3ea85ba5b45ab4fd4f3 100644 (file)
@@ -247,7 +247,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
        chunksize += SCTP_PAD4(SCTP_SAT_LEN(num_types));
        chunksize += sizeof(ecap_param);
 
-       if (asoc->prsctp_enable)
+       if (asoc->ep->prsctp_enable)
                chunksize += sizeof(prsctp_param);
 
        /* ADDIP: Section 4.2.7:
@@ -348,7 +348,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
                sctp_addto_param(retval, num_ext, extensions);
        }
 
-       if (asoc->prsctp_enable)
+       if (asoc->ep->prsctp_enable)
                sctp_addto_chunk(retval, sizeof(prsctp_param), &prsctp_param);
 
        if (sp->adaptation_ind) {
@@ -2011,7 +2011,7 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
                                asoc->peer.reconf_capable = 1;
                        break;
                case SCTP_CID_FWD_TSN:
-                       if (asoc->prsctp_enable && !asoc->peer.prsctp_capable)
+                       if (asoc->ep->prsctp_enable)
                                asoc->peer.prsctp_capable = 1;
                        break;
                case SCTP_CID_AUTH:
@@ -2636,7 +2636,7 @@ do_addr_param:
                break;
 
        case SCTP_PARAM_FWD_TSN_SUPPORT:
-               if (asoc->prsctp_enable) {
+               if (asoc->ep->prsctp_enable) {
                        asoc->peer.prsctp_capable = 1;
                        break;
                }
index d8bcc4711d4aafede2856236d8bef121e8ceda9c..54ceece59ea523f7fc0c199f6f9678a14b35bb7c 100644 (file)
@@ -7325,7 +7325,7 @@ static int sctp_getsockopt_pr_supported(struct sock *sk, int len,
                goto out;
        }
 
-       params.assoc_value = asoc ? asoc->prsctp_enable
+       params.assoc_value = asoc ? asoc->peer.prsctp_capable
                                  : sctp_sk(sk)->ep->prsctp_enable;
 
        if (put_user(len, optlen))