sctp: align MTU to a word
[cascardo/linux.git] / net / sctp / associola.c
index 2bf8ec9..e1849f3 100644 (file)
@@ -1263,7 +1263,7 @@ static struct sctp_transport *sctp_trans_elect_best(struct sctp_transport *curr,
        if (score_curr > score_best)
                return curr;
        else if (score_curr == score_best)
-               return sctp_trans_elect_tie(curr, best);
+               return sctp_trans_elect_tie(best, curr);
        else
                return best;
 }
@@ -1406,7 +1406,8 @@ void sctp_assoc_sync_pmtu(struct sock *sk, struct sctp_association *asoc)
        list_for_each_entry(t, &asoc->peer.transport_addr_list,
                                transports) {
                if (t->pmtu_pending && t->dst) {
-                       sctp_transport_update_pmtu(sk, t, dst_mtu(t->dst));
+                       sctp_transport_update_pmtu(sk, t,
+                                                  WORD_TRUNC(dst_mtu(t->dst)));
                        t->pmtu_pending = 0;
                }
                if (!pmtu || (t->pathmtu < pmtu))
@@ -1493,7 +1494,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned int len)
 
                asoc->peer.sack_needed = 0;
 
-               sctp_outq_tail(&asoc->outqueue, sack);
+               sctp_outq_tail(&asoc->outqueue, sack, GFP_ATOMIC);
 
                /* Stop the SACK timer.  */
                timer = &asoc->timers[SCTP_EVENT_TIMEOUT_SACK];