]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: not traverse asoc trans list if non-ipv6 trans exists for ipv6_flowlabel
authorXin Long <lucien.xin@gmail.com>
Mon, 3 Sep 2018 07:47:11 +0000 (15:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Sep 2018 04:57:54 +0000 (21:57 -0700)
When users set params.spp_address and get a trans, ipv6_flowlabel flag
should be applied into this trans. But even if this one is not an ipv6
trans, it should not go to apply it into all other transes of the asoc
but simply ignore it.

Fixes: b8b6ead18b1a ("sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index a0ccfa4b82205340b1c0aa6f86893e6e497b8475..f73e9d38d5ba734d7ee3347e4015fd30d355bbfa 100644 (file)
@@ -2658,10 +2658,12 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
        }
 
        if (params->spp_flags & SPP_IPV6_FLOWLABEL) {
-               if (trans && trans->ipaddr.sa.sa_family == AF_INET6) {
-                       trans->flowlabel = params->spp_ipv6_flowlabel &
-                                          SCTP_FLOWLABEL_VAL_MASK;
-                       trans->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
+               if (trans) {
+                       if (trans->ipaddr.sa.sa_family == AF_INET6) {
+                               trans->flowlabel = params->spp_ipv6_flowlabel &
+                                                  SCTP_FLOWLABEL_VAL_MASK;
+                               trans->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
+                       }
                } else if (asoc) {
                        struct sctp_transport *t;