Commit 0b0dce7a authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams

spp_ipv6_flowlabel and spp_dscp are added in sctp_paddrparams in
this patch so that users could set sctp_sock/asoc/transport dscp
and flowlabel with spp_flags SPP_IPV6_FLOWLABEL or SPP_DSCP by
SCTP_PEER_ADDR_PARAMS , as described section 8.1.12 in RFC6458.

As said in last patch, it uses '| 0x100000' or '|0x1' to mark
flowlabel or dscp is set,  so that their values could be set
to 0.

Note that to guarantee that an old app built with old kernel
headers could work on the newer kernel, the param's check in
sctp_g/setsockopt_peer_addr_params() is also improved, which
follows the way that sctp_g/setsockopt_delayed_ack() or some
other sockopts' process that accept two types of params does.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a9c58d2
...@@ -763,6 +763,8 @@ enum sctp_spp_flags { ...@@ -763,6 +763,8 @@ enum sctp_spp_flags {
SPP_SACKDELAY_DISABLE = 1<<6, /*Disable SACK*/ SPP_SACKDELAY_DISABLE = 1<<6, /*Disable SACK*/
SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE, SPP_SACKDELAY = SPP_SACKDELAY_ENABLE | SPP_SACKDELAY_DISABLE,
SPP_HB_TIME_IS_ZERO = 1<<7, /* Set HB delay to 0 */ SPP_HB_TIME_IS_ZERO = 1<<7, /* Set HB delay to 0 */
SPP_IPV6_FLOWLABEL = 1<<8,
SPP_DSCP = 1<<9,
}; };
struct sctp_paddrparams { struct sctp_paddrparams {
...@@ -773,6 +775,8 @@ struct sctp_paddrparams { ...@@ -773,6 +775,8 @@ struct sctp_paddrparams {
__u32 spp_pathmtu; __u32 spp_pathmtu;
__u32 spp_sackdelay; __u32 spp_sackdelay;
__u32 spp_flags; __u32 spp_flags;
__u32 spp_ipv6_flowlabel;
__u8 spp_dscp;
} __attribute__((packed, aligned(4))); } __attribute__((packed, aligned(4)));
/* /*
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment