key_extract(9)
π key_extract π
okay bestie, welcome to the Kernel API Manual page for key_extract β the function that pulls a flow key out of an Ethernet frame. it's giving βextract the key, set the headers, no capβ π«Ά
π NAME π
key_extract β extracts a flow key from an Ethernet frame. periodt. β¨
π SYNOPSIS π
int key_extract (struct sk_buff *skb , struct sw_flow_key *key );
πΈ ARGUMENTS πΈ
skbβ thesk_buffthat contains the frame, withskb->datapointing to the Ethernet header. that's the main character input, fr fr. πkeyβ the output flow key. this is where the key gets written out, bestie. π
π¦ DESCRIPTION π¦
so this function initializes skb header fields like this:
skb->mac_headerβ the L2 header. iconic. β¨skb->network_headerβ just past the L2 header, or just past the VLAN header, to the first byte of the L2 payload. slay. πskb->transport_headerβ Ifkey->eth.typeisETH_P_IPorETH_P_IPV6on output, then just past the IP header, if one is present and of a correct length, otherwise the same asskb->network_header. For otherkey->eth.typevalues it is left untouched. no cap, that's the whole rule. π§skb->protocolβ the type of the data starting atskb->network_header. Equals tokey->eth.type. literally matching, adorable. π
π RETURN π
0 if successful, otherwise a negative errno value. bestie, if it's negative, that's your signal something went sideways. π
π₯ SEE ALSO π₯
Kernel file ./net/openvswitch/flow.c and the besties get_ipv6_ext_hdrs(9), parse_vlan_tag(9), key_extract_l3l4(9). iykyk π
mwah π β source ./net/openvswitch, October 2026, page key_extract(9).
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms