diff options
author | Xin Long <lucien.xin@gmail.com> | 2018-03-14 19:05:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-14 13:48:27 -0400 |
commit | 1b1e0bc9947427ae58bbe7de0ce9cfd591b589b9 (patch) | |
tree | 4d113bf0c79a697420a1463d6fe1798ad6f4e0d9 /include/net/sctp/structs.h | |
parent | c469012729bda6515779590d9588d3e36fdf449d (diff) | |
download | linux-1b1e0bc9947427ae58bbe7de0ce9cfd591b589b9.tar.bz2 |
sctp: add refcnt support for sh_key
With refcnt support for sh_key, chunks auth sh_keys can be decided
before enqueuing it. Changing the active key later will not affect
the chunks already enqueued.
Furthermore, this is necessary when adding the support for authinfo
for sendmsg in next patch.
Note that struct sctp_chunk can't be grown due to that performance
drop issue on slow cpu, so it just reuses head_skb memory for shkey
in sctp_chunk.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r-- | include/net/sctp/structs.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ec6e46b7e119..49ad67bbdbb5 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -577,8 +577,12 @@ struct sctp_chunk { /* This points to the sk_buff containing the actual data. */ struct sk_buff *skb; - /* In case of GSO packets, this will store the head one */ - struct sk_buff *head_skb; + union { + /* In case of GSO packets, this will store the head one */ + struct sk_buff *head_skb; + /* In case of auth enabled, this will point to the shkey */ + struct sctp_shared_key *shkey; + }; /* These are the SCTP headers by reverse order in a packet. * Note that some of these may happen more than once. In that @@ -1995,6 +1999,7 @@ struct sctp_association { * The current generated assocaition shared key (secret) */ struct sctp_auth_bytes *asoc_shared_key; + struct sctp_shared_key *shkey; /* SCTP AUTH: hmac id of the first peer requested algorithm * that we support. |