提交 1ff01561 编写于 作者: M Marcelo Ricardo Leitner 提交者: David S. Miller

sctp: reduce indent level in sctp_sf_shut_8_4_5

Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eab59075
...@@ -3501,45 +3501,43 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(struct net *net, ...@@ -3501,45 +3501,43 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(struct net *net,
struct sctp_chunk *shut; struct sctp_chunk *shut;
packet = sctp_ootb_pkt_new(net, asoc, chunk); packet = sctp_ootb_pkt_new(net, asoc, chunk);
if (!packet)
return SCTP_DISPOSITION_NOMEM;
if (packet) { /* Make an SHUTDOWN_COMPLETE.
/* Make an SHUTDOWN_COMPLETE. * The T bit will be set if the asoc is NULL.
* The T bit will be set if the asoc is NULL. */
*/ shut = sctp_make_shutdown_complete(asoc, chunk);
shut = sctp_make_shutdown_complete(asoc, chunk); if (!shut) {
if (!shut) { sctp_ootb_pkt_free(packet);
sctp_ootb_pkt_free(packet); return SCTP_DISPOSITION_NOMEM;
return SCTP_DISPOSITION_NOMEM; }
}
/* Reflect vtag if T-Bit is set */
if (sctp_test_T_bit(shut))
packet->vtag = ntohl(chunk->sctp_hdr->vtag);
/* Set the skb to the belonging sock for accounting. */ /* Reflect vtag if T-Bit is set */
shut->skb->sk = ep->base.sk; if (sctp_test_T_bit(shut))
packet->vtag = ntohl(chunk->sctp_hdr->vtag);
sctp_packet_append_chunk(packet, shut); /* Set the skb to the belonging sock for accounting. */
shut->skb->sk = ep->base.sk;
sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, sctp_packet_append_chunk(packet, shut);
SCTP_PACKET(packet));
SCTP_INC_STATS(net, SCTP_MIB_OUTCTRLCHUNKS); sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
SCTP_PACKET(packet));
/* If the chunk length is invalid, we don't want to process SCTP_INC_STATS(net, SCTP_MIB_OUTCTRLCHUNKS);
* the reset of the packet.
*/
if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
/* We need to discard the rest of the packet to prevent /* If the chunk length is invalid, we don't want to process
* potential bomming attacks from additional bundled chunks. * the reset of the packet.
* This is documented in SCTP Threats ID. */
*/ if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
}
return SCTP_DISPOSITION_NOMEM; /* We need to discard the rest of the packet to prevent
* potential bomming attacks from additional bundled chunks.
* This is documented in SCTP Threats ID.
*/
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册