|
@@ -37,6 +37,7 @@
|
|
|
#include <net/flow_dissector.h>
|
|
|
#include <linux/splice.h>
|
|
|
#include <linux/in6.h>
|
|
|
+#include <linux/if_packet.h>
|
|
|
#include <net/flow.h>
|
|
|
|
|
|
/* The interface for checksum offload between the stack and networking drivers
|
|
@@ -881,6 +882,15 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
|
|
|
return (struct rtable *)skb_dst(skb);
|
|
|
}
|
|
|
|
|
|
+/* For mangling skb->pkt_type from user space side from applications
|
|
|
+ * such as nft, tc, etc, we only allow a conservative subset of
|
|
|
+ * possible pkt_types to be set.
|
|
|
+*/
|
|
|
+static inline bool skb_pkt_type_ok(u32 ptype)
|
|
|
+{
|
|
|
+ return ptype <= PACKET_OTHERHOST;
|
|
|
+}
|
|
|
+
|
|
|
void kfree_skb(struct sk_buff *skb);
|
|
|
void kfree_skb_list(struct sk_buff *segs);
|
|
|
void skb_tx_error(struct sk_buff *skb);
|