提交 5f8f1c3c 编写于 作者: W Wei Yongjun 提交者: Vlad Yasevich

SCTP: remove useless code in function sctp_init_cause

Some code in function sctp_init_cause() seem useless, this patch remove
them.
Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
上级 aecedeab
...@@ -113,15 +113,12 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, ...@@ -113,15 +113,12 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
const void *payload, size_t paylen) const void *payload, size_t paylen)
{ {
sctp_errhdr_t err; sctp_errhdr_t err;
int padlen;
__u16 len; __u16 len;
/* Cause code constants are now defined in network order. */ /* Cause code constants are now defined in network order. */
err.cause = cause_code; err.cause = cause_code;
len = sizeof(sctp_errhdr_t) + paylen; len = sizeof(sctp_errhdr_t) + paylen;
padlen = len % 4;
err.length = htons(len); err.length = htons(len);
len += padlen;
chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
sctp_addto_chunk(chunk, paylen, payload); sctp_addto_chunk(chunk, paylen, payload);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册