.. | .. |
---|
10 | 10 | #include <net/flow.h> |
---|
11 | 11 | #include <net/rtnetlink.h> |
---|
12 | 12 | #include <net/fib_notifier.h> |
---|
| 13 | +#include <linux/indirect_call_wrapper.h> |
---|
13 | 14 | |
---|
14 | 15 | struct fib_kuid_range { |
---|
15 | 16 | kuid_t start; |
---|
.. | .. |
---|
68 | 69 | int (*action)(struct fib_rule *, |
---|
69 | 70 | struct flowi *, int, |
---|
70 | 71 | 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__ |
---|
71 | 76 | bool (*suppress)(struct fib_rule *, |
---|
| 77 | +#else |
---|
| 78 | + bool (*suppress)(struct fib_rule *, int, |
---|
| 79 | +#endif |
---|
72 | 80 | struct fib_lookup_arg *); |
---|
73 | 81 | int (*match)(struct fib_rule *, |
---|
74 | 82 | struct flowi *, int); |
---|
.. | .. |
---|
103 | 111 | }; |
---|
104 | 112 | |
---|
105 | 113 | #define FRA_GENERIC_POLICY \ |
---|
| 114 | + [FRA_UNSPEC] = { .strict_start_type = FRA_DPORT_RANGE + 1 }, \ |
---|
106 | 115 | [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ |
---|
107 | 116 | [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ |
---|
108 | 117 | [FRA_PRIORITY] = { .type = NLA_U32 }, \ |
---|
.. | .. |
---|
180 | 189 | |
---|
181 | 190 | static inline bool fib_rule_requires_fldissect(struct fib_rule *rule) |
---|
182 | 191 | { |
---|
183 | | - return rule->ip_proto || |
---|
| 192 | + return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto || |
---|
184 | 193 | 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)); |
---|
186 | 195 | } |
---|
187 | 196 | |
---|
188 | 197 | struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, |
---|
.. | .. |
---|
194 | 203 | int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table, |
---|
195 | 204 | u32 flags); |
---|
196 | 205 | 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); |
---|
198 | 208 | unsigned int fib_rules_seq_read(struct net *net, int family); |
---|
199 | 209 | |
---|
200 | 210 | int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, |
---|
201 | 211 | struct netlink_ext_ack *extack); |
---|
202 | 212 | int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh, |
---|
203 | 213 | 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)); |
---|
204 | 233 | #endif |
---|