aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2007-09-12 09:16:21 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:19 -0400
commit5c94bf86c865fb779f1743672b4d0f6cdd706728 (patch)
tree10c507e54cf2609afe8a5ad30fbaf67c58192cdc /net/sctp/sm_make_chunk.c
parent464771fe4743afd00ebff65aee0983fa1aa1da4f (diff)
[SCTP]: Make sctp_addto_param() static.
sctp_addto_param() can become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 23ae37ec8711..d84e575f7409 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -839,6 +839,26 @@ err_chunk:
839 return retval; 839 return retval;
840} 840}
841 841
842/* Append bytes to the end of a parameter. Will panic if chunk is not big
843 * enough.
844 */
845static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
846 const void *data)
847{
848 void *target;
849 int chunklen = ntohs(chunk->chunk_hdr->length);
850
851 target = skb_put(chunk->skb, len);
852
853 memcpy(target, data, len);
854
855 /* Adjust the chunk length field. */
856 chunk->chunk_hdr->length = htons(chunklen + len);
857 chunk->chunk_end = skb_tail_pointer(chunk->skb);
858
859 return target;
860}
861
842/* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */ 862/* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */
843struct sctp_chunk *sctp_make_abort_violation( 863struct sctp_chunk *sctp_make_abort_violation(
844 const struct sctp_association *asoc, 864 const struct sctp_association *asoc,
@@ -1146,25 +1166,6 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
1146 return target; 1166 return target;
1147} 1167}
1148 1168
1149/* Append bytes to the end of a parameter. Will panic if chunk is not big
1150 * enough.
1151 */
1152void *sctp_addto_param(struct sctp_chunk *chunk, int len, const void *data)
1153{
1154 void *target;
1155 int chunklen = ntohs(chunk->chunk_hdr->length);
1156
1157 target = skb_put(chunk->skb, len);
1158
1159 memcpy(target, data, len);
1160
1161 /* Adjust the chunk length field. */
1162 chunk->chunk_hdr->length = htons(chunklen + len);
1163 chunk->chunk_end = skb_tail_pointer(chunk->skb);
1164
1165 return target;
1166}
1167
1168/* Append bytes from user space to the end of a chunk. Will panic if 1169/* Append bytes from user space to the end of a chunk. Will panic if
1169 * chunk is not big enough. 1170 * chunk is not big enough.
1170 * Returns a kernel err value. 1171 * Returns a kernel err value.