Commit 5c94bf86 authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

[SCTP]: Make sctp_addto_param() static.

sctp_addto_param() can become static.
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 464771fe
...@@ -731,7 +731,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, ...@@ -731,7 +731,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
struct iovec *data); struct iovec *data);
void sctp_chunk_free(struct sctp_chunk *); void sctp_chunk_free(struct sctp_chunk *);
void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 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 *, struct sctp_chunk *sctp_chunkify(struct sk_buff *,
const struct sctp_association *, const struct sctp_association *,
struct sock *); struct sock *);
......
...@@ -839,6 +839,26 @@ struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, ...@@ -839,6 +839,26 @@ struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
return retval; 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. */ /* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */
struct sctp_chunk *sctp_make_abort_violation( struct sctp_chunk *sctp_make_abort_violation(
const struct sctp_association *asoc, const struct sctp_association *asoc,
...@@ -1146,25 +1166,6 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data) ...@@ -1146,25 +1166,6 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
return target; 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 /* Append bytes from user space to the end of a chunk. Will panic if
* chunk is not big enough. * chunk is not big enough.
* Returns a kernel err value. * Returns a kernel err value.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment