Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256020
b: refs/heads/master
c: 7fd71b1
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and David S. Miller committed Jul 1, 2011
1 parent 6f745f5 commit d8ff59b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c485538901e0334a3016241bf73b864216ff2e73
refs/heads/master: 7fd71b1e0787d4d32c6225ca59e23e522cd67cc3
51 changes: 26 additions & 25 deletions trunk/net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -4008,31 +4008,32 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep,
auth_hdr = (struct sctp_authhdr *)chunk->skb->data;
error = sctp_sf_authenticate(ep, asoc, type, chunk);
switch (error) {
case SCTP_IERROR_AUTH_BAD_HMAC:
/* Generate the ERROR chunk and discard the rest
* of the packet
*/
err_chunk = sctp_make_op_error(asoc, chunk,
SCTP_ERROR_UNSUP_HMAC,
&auth_hdr->hmac_id,
sizeof(__u16), 0);
if (err_chunk) {
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
SCTP_CHUNK(err_chunk));
}
/* Fall Through */
case SCTP_IERROR_AUTH_BAD_KEYID:
case SCTP_IERROR_BAD_SIG:
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
break;
case SCTP_IERROR_PROTO_VIOLATION:
return sctp_sf_violation_chunklen(ep, asoc, type, arg,
commands);
break;
case SCTP_IERROR_NOMEM:
return SCTP_DISPOSITION_NOMEM;
default:
break;
case SCTP_IERROR_AUTH_BAD_HMAC:
/* Generate the ERROR chunk and discard the rest
* of the packet
*/
err_chunk = sctp_make_op_error(asoc, chunk,
SCTP_ERROR_UNSUP_HMAC,
&auth_hdr->hmac_id,
sizeof(__u16), 0);
if (err_chunk) {
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
SCTP_CHUNK(err_chunk));
}
/* Fall Through */
case SCTP_IERROR_AUTH_BAD_KEYID:
case SCTP_IERROR_BAD_SIG:
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);

case SCTP_IERROR_PROTO_VIOLATION:
return sctp_sf_violation_chunklen(ep, asoc, type, arg,
commands);

case SCTP_IERROR_NOMEM:
return SCTP_DISPOSITION_NOMEM;

default: /* Prevent gcc warnings */
break;
}

if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) {
Expand Down
10 changes: 5 additions & 5 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3257,11 +3257,11 @@ static int sctp_setsockopt_auth_chunk(struct sock *sk,
return -EFAULT;

switch (val.sauth_chunk) {
case SCTP_CID_INIT:
case SCTP_CID_INIT_ACK:
case SCTP_CID_SHUTDOWN_COMPLETE:
case SCTP_CID_AUTH:
return -EINVAL;
case SCTP_CID_INIT:
case SCTP_CID_INIT_ACK:
case SCTP_CID_SHUTDOWN_COMPLETE:
case SCTP_CID_AUTH:
return -EINVAL;
}

/* add this chunk id to the endpoint */
Expand Down

0 comments on commit d8ff59b

Please sign in to comment.