X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=net%2Fsctp%2Fchunk.c;h=4d3128f5ccc3f304676c8022410c40b32c3cf6d9;hb=83db33a3e5c4200eaf5dec5b4883c0e73f468a3b;hp=83ef411772f46f1494175d0320a0f4d43d134b46;hpb=dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7;p=safe%2Fjmp%2Flinux-2.6 diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 83ef411..4d3128f 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c @@ -1,17 +1,17 @@ -/* SCTP kernel reference Implementation +/* SCTP kernel implementation * (C) Copyright IBM Corp. 2003, 2004 * - * This file is part of the SCTP kernel reference Implementation + * This file is part of the SCTP kernel implementation * - * This file contains the code relating the the chunk abstraction. + * This file contains the code relating the chunk abstraction. * - * The SCTP reference implementation is free software; + * This SCTP implementation is free software; * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * - * The SCTP reference implementation is distributed in the hope that it + * This SCTP implementation is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied * ************************ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -194,6 +194,18 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, max = asoc->frag_point; + /* If the the peer requested that we authenticate DATA chunks + * we need to accound for bundling of the AUTH chunks along with + * DATA. + */ + if (sctp_auth_send_cid(SCTP_CID_DATA, asoc)) { + struct sctp_hmac *hmac_desc = sctp_auth_asoc_get_hmac(asoc); + + if (hmac_desc) + max -= WORD_ROUND(sizeof(sctp_auth_chunk_t) + + hmac_desc->hmac_len); + } + whole = 0; first_len = max;