Thread (20 messages) 20 messages, 4 authors, 2019-09-13

Re: [PATCH net-next 5/5] sctp: add spt_pathcpthld in struct sctp_paddrthlds

From: Xin Long <lucien.xin@gmail.com>
Date: 2019-09-11 08:14:52
Also in: linux-sctp

On Wed, Sep 11, 2019 at 1:27 AM David Miller [off-list ref] wrote:
From: Xin Long <lucien.xin@gmail.com>
Date: Mon,  9 Sep 2019 15:56:51 +0800
quoted
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index a15cc28..dfd81e1 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -1069,6 +1069,7 @@ struct sctp_paddrthlds {
      struct sockaddr_storage spt_address;
      __u16 spt_pathmaxrxt;
      __u16 spt_pathpfthld;
+     __u16 spt_pathcpthld;
 };

 /*
As pointed out you can't add things to this structure without breaking existing
binaries.
we had the same problem when adding:
spp_ipv6_flowlabel and spp_dscp into struct sctp_paddrparams. in:

commit 0b0dce7a36fb9f1a9dd8245ea82d3a268c6943fe
Author: Xin Long [off-list ref]
Date:   Mon Jul 2 18:21:13 2018 +0800

    sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams

the solution was:

        if (optlen == sizeof(params)) {
                if (copy_from_user(&params, optval, optlen))
                        return -EFAULT;
        } else if (optlen == ALIGN(offsetof(struct sctp_paddrparams,
                                            spp_ipv6_flowlabel), 4)) {
                if (copy_from_user(&params, optval, optlen))
                        return -EFAULT;
                if (params.spp_flags & (SPP_DSCP | SPP_IPV6_FLOWLABEL))
                        return -EINVAL;
        } else {
                return -EINVAL;
        }

I will do the same for this patch. Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help