Commit 72863087 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by David S. Miller

net/tcp: Add a helper tcp_ao_hdr_maclen()

It's going to be used more in TCP-AO tracepoints.
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3966a668
...@@ -19,6 +19,11 @@ struct tcp_ao_hdr { ...@@ -19,6 +19,11 @@ struct tcp_ao_hdr {
u8 rnext_keyid; u8 rnext_keyid;
}; };
static inline u8 tcp_ao_hdr_maclen(const struct tcp_ao_hdr *aoh)
{
return aoh->length - sizeof(struct tcp_ao_hdr);
}
struct tcp_ao_counters { struct tcp_ao_counters {
atomic64_t pkt_good; atomic64_t pkt_good;
atomic64_t pkt_bad; atomic64_t pkt_bad;
......
...@@ -884,8 +884,8 @@ tcp_ao_verify_hash(const struct sock *sk, const struct sk_buff *skb, ...@@ -884,8 +884,8 @@ tcp_ao_verify_hash(const struct sock *sk, const struct sk_buff *skb,
const struct tcp_ao_hdr *aoh, struct tcp_ao_key *key, const struct tcp_ao_hdr *aoh, struct tcp_ao_key *key,
u8 *traffic_key, u8 *phash, u32 sne, int l3index) u8 *traffic_key, u8 *phash, u32 sne, int l3index)
{ {
u8 maclen = aoh->length - sizeof(struct tcp_ao_hdr);
const struct tcphdr *th = tcp_hdr(skb); const struct tcphdr *th = tcp_hdr(skb);
u8 maclen = tcp_ao_hdr_maclen(aoh);
void *hash_buf = NULL; void *hash_buf = NULL;
if (maclen != tcp_ao_maclen(key)) { if (maclen != tcp_ao_maclen(key)) {
......
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