hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/net/fib_rules.h
....@@ -10,6 +10,7 @@
1010 #include <net/flow.h>
1111 #include <net/rtnetlink.h>
1212 #include <net/fib_notifier.h>
13
+#include <linux/indirect_call_wrapper.h>
1314
1415 struct fib_kuid_range {
1516 kuid_t start;
....@@ -68,7 +69,14 @@
6869 int (*action)(struct fib_rule *,
6970 struct flowi *, int,
7071 struct fib_lookup_arg *);
72
+ /* __GENKSYMS__ hack to preserve the abi change that happened in
73
+ * cdef485217d3 ("ipv6: fix memory leak in fib6_rule_suppress")
74
+ */
75
+#ifdef __GENKSYMS__
7176 bool (*suppress)(struct fib_rule *,
77
+#else
78
+ bool (*suppress)(struct fib_rule *, int,
79
+#endif
7280 struct fib_lookup_arg *);
7381 int (*match)(struct fib_rule *,
7482 struct flowi *, int);
....@@ -103,6 +111,7 @@
103111 };
104112
105113 #define FRA_GENERIC_POLICY \
114
+ [FRA_UNSPEC] = { .strict_start_type = FRA_DPORT_RANGE + 1 }, \
106115 [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
107116 [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
108117 [FRA_PRIORITY] = { .type = NLA_U32 }, \
....@@ -180,9 +189,9 @@
180189
181190 static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
182191 {
183
- return rule->ip_proto ||
192
+ return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto ||
184193 fib_rule_port_range_set(&rule->sport_range) ||
185
- fib_rule_port_range_set(&rule->dport_range);
194
+ fib_rule_port_range_set(&rule->dport_range));
186195 }
187196
188197 struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,
....@@ -194,11 +203,31 @@
194203 int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table,
195204 u32 flags);
196205 bool fib_rule_matchall(const struct fib_rule *rule);
197
-int fib_rules_dump(struct net *net, struct notifier_block *nb, int family);
206
+int fib_rules_dump(struct net *net, struct notifier_block *nb, int family,
207
+ struct netlink_ext_ack *extack);
198208 unsigned int fib_rules_seq_read(struct net *net, int family);
199209
200210 int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
201211 struct netlink_ext_ack *extack);
202212 int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh,
203213 struct netlink_ext_ack *extack);
214
+
215
+INDIRECT_CALLABLE_DECLARE(int fib6_rule_match(struct fib_rule *rule,
216
+ struct flowi *fl, int flags));
217
+INDIRECT_CALLABLE_DECLARE(int fib4_rule_match(struct fib_rule *rule,
218
+ struct flowi *fl, int flags));
219
+
220
+INDIRECT_CALLABLE_DECLARE(int fib6_rule_action(struct fib_rule *rule,
221
+ struct flowi *flp, int flags,
222
+ struct fib_lookup_arg *arg));
223
+INDIRECT_CALLABLE_DECLARE(int fib4_rule_action(struct fib_rule *rule,
224
+ struct flowi *flp, int flags,
225
+ struct fib_lookup_arg *arg));
226
+
227
+INDIRECT_CALLABLE_DECLARE(bool fib6_rule_suppress(struct fib_rule *rule,
228
+ int flags,
229
+ struct fib_lookup_arg *arg));
230
+INDIRECT_CALLABLE_DECLARE(bool fib4_rule_suppress(struct fib_rule *rule,
231
+ int flags,
232
+ struct fib_lookup_arg *arg));
204233 #endif