mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
sctp: only check for ECN if peer is using it
Currently only read-only checks are performed up to the point on where we check if peer is ECN capable, checks which we can avoid otherwise. The flag ecn_ce_done is only used to perform this check once per incoming packet, and nothing more. Thus this patch moves the peer check up. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d9cef42529
commit
2d47fd120d
1 changed files with 2 additions and 3 deletions
|
@ -6118,12 +6118,11 @@ static int sctp_eat_data(const struct sctp_association *asoc,
|
||||||
* chunk later.
|
* chunk later.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!chunk->ecn_ce_done) {
|
if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) {
|
||||||
struct sctp_af *af = SCTP_INPUT_CB(chunk->skb)->af;
|
struct sctp_af *af = SCTP_INPUT_CB(chunk->skb)->af;
|
||||||
chunk->ecn_ce_done = 1;
|
chunk->ecn_ce_done = 1;
|
||||||
|
|
||||||
if (af->is_ce(sctp_gso_headskb(chunk->skb)) &&
|
if (af->is_ce(sctp_gso_headskb(chunk->skb))) {
|
||||||
asoc->peer.ecn_capable) {
|
|
||||||
/* Do real work as sideffect. */
|
/* Do real work as sideffect. */
|
||||||
sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
|
sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
|
||||||
SCTP_U32(tsn));
|
SCTP_U32(tsn));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue