Add pkttype support for ip, ipv6 and inet families of tables. This allows you to fetch the meta packet type based on the link layer information. The loopback traffic is a special case, the packet type is guessed from the network layer header. No special handling for bridge and arp since we're not going to see such traffic in the loopback interface. Joint work with Alvaro Neira Ayuso <alvaroneay@gmail.com>
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -571,6 +571,7 @@ enum nft_exthdr_attributes { · 570 unmodified lines | ||
| 571 | 571 | * @NFT_META_L4PROTO: layer 4 protocol number |
| 572 | 572 | * @NFT_META_BRI_IIFNAME: packet input bridge interface name |
| 573 | 573 | * @NFT_META_BRI_OIFNAME: packet output bridge interface name |
| 574 | + * @NFT_META_PKTTYPE: packet type (skb->pkt_type), special handling for loopback | |
| 574 | 575 | */ |
| 575 | 576 | enum nft_meta_keys { |
| 576 | 577 | NFT_META_LEN, |
| @@ -592,6 +593,7 @@ enum nft_meta_keys { · 15 unmodified lines | ||
| 592 | 593 | NFT_META_L4PROTO, |
| 593 | 594 | NFT_META_BRI_IIFNAME, |
| 594 | 595 | NFT_META_BRI_OIFNAME, |
| 596 | + NFT_META_PKTTYPE, | |
| 595 | 597 | }; |
| 596 | 598 | |
| 597 | 599 | /** |