Skip to content

Commit

Permalink
net/dccp: expansion of error code size
Browse files Browse the repository at this point in the history
Because MIPS's EDQUOT value is 1133(0x46d).
It's larger than u8.

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yoichi Yuasa authored and David S. Miller committed May 25, 2010
1 parent 5eb32bd commit d9b52dc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/dccp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ static int dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
return queued;
}

static u8 dccp_reset_code_convert(const u8 code)
static u16 dccp_reset_code_convert(const u8 code)
{
const u8 error_code[] = {
const u16 error_code[] = {
[DCCP_RESET_CODE_CLOSED] = 0, /* normal termination */
[DCCP_RESET_CODE_UNSPECIFIED] = 0, /* nothing known */
[DCCP_RESET_CODE_ABORTED] = ECONNRESET,
Expand All @@ -148,7 +148,7 @@ static u8 dccp_reset_code_convert(const u8 code)

static void dccp_rcv_reset(struct sock *sk, struct sk_buff *skb)
{
u8 err = dccp_reset_code_convert(dccp_hdr_reset(skb)->dccph_reset_code);
u16 err = dccp_reset_code_convert(dccp_hdr_reset(skb)->dccph_reset_code);

sk->sk_err = err;

Expand Down

0 comments on commit d9b52dc

Please sign in to comment.