Skip to content

Helper function bpf_get_hash_recalc

v4.8

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Retrieve the hash of the packet, skb->hash. If it is not set, in particular if the hash was cleared due to mangling, recompute this hash. Later accesses to the hash can be done directly with skb->hash.

Calling bpf_set_hash_invalid(), changing a packet prototype with bpf_skb_change_proto(), or calling bpf_skb_store_bytes() with the BPF_F_INVALIDATE_HASH are actions susceptible to clear the hash and to trigger a new computation for the next call to bpf_get_hash_recalc().

Returns

The 32-bit hash.

static __u32 (* const bpf_get_hash_recalc)(struct __sk_buff *skb) = (void *) 34;

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome