From 244b2c5ca8b14627e4a17755e5922221e121c771 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 09 Oct 2024 06:15:07 +0000
Subject: [PATCH] change system file
---
kernel/include/linux/netfilter/nfnetlink.h | 42 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/kernel/include/linux/netfilter/nfnetlink.h b/kernel/include/linux/netfilter/nfnetlink.h
index e713476..b38e1dc 100644
--- a/kernel/include/linux/netfilter/nfnetlink.h
+++ b/kernel/include/linux/netfilter/nfnetlink.h
@@ -4,6 +4,7 @@
#include <linux/netlink.h>
#include <linux/capability.h>
+#include <linux/android_kabi.h>
#include <net/netlink.h>
#include <uapi/linux/netfilter/nfnetlink.h>
@@ -22,6 +23,14 @@
struct netlink_ext_ack *extack);
const struct nla_policy *policy; /* netlink attribute policy */
const u_int16_t attr_count; /* number of nlattr's */
+
+ ANDROID_KABI_RESERVE(1);
+};
+
+enum nfnl_abort_action {
+ NFNL_ABORT_NONE = 0,
+ NFNL_ABORT_AUTOLOAD,
+ NFNL_ABORT_VALIDATE,
};
struct nfnetlink_subsystem {
@@ -31,9 +40,11 @@
const struct nfnl_callback *cb; /* callback for individual types */
struct module *owner;
int (*commit)(struct net *net, struct sk_buff *skb);
- int (*abort)(struct net *net, struct sk_buff *skb);
- void (*cleanup)(struct net *net);
+ int (*abort)(struct net *net, struct sk_buff *skb,
+ enum nfnl_abort_action action);
bool (*valid_genid)(struct net *net, u32 genid);
+
+ ANDROID_KABI_RESERVE(1);
};
int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
@@ -50,6 +61,33 @@
return subsys << 8 | msg_type;
}
+static inline void nfnl_fill_hdr(struct nlmsghdr *nlh, u8 family, u8 version,
+ __be16 res_id)
+{
+ struct nfgenmsg *nfmsg;
+
+ nfmsg = nlmsg_data(nlh);
+ nfmsg->nfgen_family = family;
+ nfmsg->version = version;
+ nfmsg->res_id = res_id;
+}
+
+static inline struct nlmsghdr *nfnl_msg_put(struct sk_buff *skb, u32 portid,
+ u32 seq, int type, int flags,
+ u8 family, u8 version,
+ __be16 res_id)
+{
+ struct nlmsghdr *nlh;
+
+ nlh = nlmsg_put(skb, portid, seq, type, sizeof(struct nfgenmsg), flags);
+ if (!nlh)
+ return NULL;
+
+ nfnl_fill_hdr(nlh, family, version, res_id);
+
+ return nlh;
+}
+
void nfnl_lock(__u8 subsys_id);
void nfnl_unlock(__u8 subsys_id);
#ifdef CONFIG_PROVE_LOCKING
--
Gitblit v1.6.2