Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66403
b: refs/heads/master
c: 5c94bf8
h: refs/heads/master
i:
  66401: 51d8647
  66399: 06f34e4
v: v3
  • Loading branch information
Adrian Bunk authored and David S. Miller committed Oct 10, 2007
1 parent a2086e3 commit ad8891c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 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: 464771fe4743afd00ebff65aee0983fa1aa1da4f
refs/heads/master: 5c94bf86c865fb779f1743672b4d0f6cdd706728
1 change: 0 additions & 1 deletion trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
struct iovec *data);
void sctp_chunk_free(struct sctp_chunk *);
void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
void *sctp_addto_param(struct sctp_chunk *, int len, const void *data);
struct sctp_chunk *sctp_chunkify(struct sk_buff *,
const struct sctp_association *,
struct sock *);
Expand Down
39 changes: 20 additions & 19 deletions trunk/net/sctp/sm_make_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,26 @@ struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
return retval;
}

/* Append bytes to the end of a parameter. Will panic if chunk is not big
* enough.
*/
static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
const void *data)
{
void *target;
int chunklen = ntohs(chunk->chunk_hdr->length);

target = skb_put(chunk->skb, len);

memcpy(target, data, len);

/* Adjust the chunk length field. */
chunk->chunk_hdr->length = htons(chunklen + len);
chunk->chunk_end = skb_tail_pointer(chunk->skb);

return target;
}

/* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */
struct sctp_chunk *sctp_make_abort_violation(
const struct sctp_association *asoc,
Expand Down Expand Up @@ -1146,25 +1166,6 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
return target;
}

/* Append bytes to the end of a parameter. Will panic if chunk is not big
* enough.
*/
void *sctp_addto_param(struct sctp_chunk *chunk, int len, const void *data)
{
void *target;
int chunklen = ntohs(chunk->chunk_hdr->length);

target = skb_put(chunk->skb, len);

memcpy(target, data, len);

/* Adjust the chunk length field. */
chunk->chunk_hdr->length = htons(chunklen + len);
chunk->chunk_end = skb_tail_pointer(chunk->skb);

return target;
}

/* Append bytes from user space to the end of a chunk. Will panic if
* chunk is not big enough.
* Returns a kernel err value.
Expand Down

0 comments on commit ad8891c

Please sign in to comment.