Commit 6570aa1d authored by David S. Miller's avatar David S. Miller

Merge branch 'sctp-two-fixes-for-spp_ipv6_flowlabel-and-spp_dscp-sockopts'

Xin Long says:

====================
sctp: two fixes for spp_ipv6_flowlabel and spp_dscp sockopts

This patchset fixes two problems in sctp_apply_peer_addr_params()
when setting spp_ipv6_flowlabel or spp_dscp.
====================
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents bf68066f 741880e1
...@@ -2658,19 +2658,22 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, ...@@ -2658,19 +2658,22 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
} }
if (params->spp_flags & SPP_IPV6_FLOWLABEL) { if (params->spp_flags & SPP_IPV6_FLOWLABEL) {
if (trans && trans->ipaddr.sa.sa_family == AF_INET6) { if (trans) {
if (trans->ipaddr.sa.sa_family == AF_INET6) {
trans->flowlabel = params->spp_ipv6_flowlabel & trans->flowlabel = params->spp_ipv6_flowlabel &
SCTP_FLOWLABEL_VAL_MASK; SCTP_FLOWLABEL_VAL_MASK;
trans->flowlabel |= SCTP_FLOWLABEL_SET_MASK; trans->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
}
} else if (asoc) { } else if (asoc) {
list_for_each_entry(trans, struct sctp_transport *t;
&asoc->peer.transport_addr_list,
list_for_each_entry(t, &asoc->peer.transport_addr_list,
transports) { transports) {
if (trans->ipaddr.sa.sa_family != AF_INET6) if (t->ipaddr.sa.sa_family != AF_INET6)
continue; continue;
trans->flowlabel = params->spp_ipv6_flowlabel & t->flowlabel = params->spp_ipv6_flowlabel &
SCTP_FLOWLABEL_VAL_MASK; SCTP_FLOWLABEL_VAL_MASK;
trans->flowlabel |= SCTP_FLOWLABEL_SET_MASK; t->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
} }
asoc->flowlabel = params->spp_ipv6_flowlabel & asoc->flowlabel = params->spp_ipv6_flowlabel &
SCTP_FLOWLABEL_VAL_MASK; SCTP_FLOWLABEL_VAL_MASK;
...@@ -2687,12 +2690,13 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, ...@@ -2687,12 +2690,13 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
trans->dscp = params->spp_dscp & SCTP_DSCP_VAL_MASK; trans->dscp = params->spp_dscp & SCTP_DSCP_VAL_MASK;
trans->dscp |= SCTP_DSCP_SET_MASK; trans->dscp |= SCTP_DSCP_SET_MASK;
} else if (asoc) { } else if (asoc) {
list_for_each_entry(trans, struct sctp_transport *t;
&asoc->peer.transport_addr_list,
list_for_each_entry(t, &asoc->peer.transport_addr_list,
transports) { transports) {
trans->dscp = params->spp_dscp & t->dscp = params->spp_dscp &
SCTP_DSCP_VAL_MASK; SCTP_DSCP_VAL_MASK;
trans->dscp |= SCTP_DSCP_SET_MASK; t->dscp |= SCTP_DSCP_SET_MASK;
} }
asoc->dscp = params->spp_dscp & SCTP_DSCP_VAL_MASK; asoc->dscp = params->spp_dscp & SCTP_DSCP_VAL_MASK;
asoc->dscp |= SCTP_DSCP_SET_MASK; asoc->dscp |= SCTP_DSCP_SET_MASK;
......
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