hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/ipv6/addrconf_core.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * IPv6 library code, needed by static components when full IPv6 support is
34 * not configured or static.
....@@ -5,6 +6,7 @@
56
67 #include <linux/export.h>
78 #include <net/ipv6.h>
9
+#include <net/ipv6_stubs.h>
810 #include <net/addrconf.h>
911 #include <net/ip.h>
1012
....@@ -135,47 +137,78 @@
135137 return ERR_PTR(-EAFNOSUPPORT);
136138 }
137139
140
+static int eafnosupport_ipv6_route_input(struct sk_buff *skb)
141
+{
142
+ return -EAFNOSUPPORT;
143
+}
144
+
138145 static struct fib6_table *eafnosupport_fib6_get_table(struct net *net, u32 id)
139146 {
140147 return NULL;
141148 }
142149
143
-static struct fib6_info *
150
+static int
144151 eafnosupport_fib6_table_lookup(struct net *net, struct fib6_table *table,
145
- int oif, struct flowi6 *fl6, int flags)
152
+ int oif, struct flowi6 *fl6,
153
+ struct fib6_result *res, int flags)
146154 {
147
- return NULL;
155
+ return -EAFNOSUPPORT;
148156 }
149157
150
-static struct fib6_info *
158
+static int
151159 eafnosupport_fib6_lookup(struct net *net, int oif, struct flowi6 *fl6,
152
- int flags)
160
+ struct fib6_result *res, int flags)
153161 {
154
- return NULL;
162
+ return -EAFNOSUPPORT;
155163 }
156164
157
-static struct fib6_info *
158
-eafnosupport_fib6_multipath_select(const struct net *net, struct fib6_info *f6i,
159
- struct flowi6 *fl6, int oif,
160
- const struct sk_buff *skb, int strict)
165
+static void
166
+eafnosupport_fib6_select_path(const struct net *net, struct fib6_result *res,
167
+ struct flowi6 *fl6, int oif, bool have_oif_match,
168
+ const struct sk_buff *skb, int strict)
161169 {
162
- return f6i;
163170 }
164171
165172 static u32
166
-eafnosupport_ip6_mtu_from_fib6(struct fib6_info *f6i, struct in6_addr *daddr,
167
- struct in6_addr *saddr)
173
+eafnosupport_ip6_mtu_from_fib6(const struct fib6_result *res,
174
+ const struct in6_addr *daddr,
175
+ const struct in6_addr *saddr)
168176 {
169177 return 0;
170178 }
171179
180
+static int eafnosupport_fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
181
+ struct fib6_config *cfg, gfp_t gfp_flags,
182
+ struct netlink_ext_ack *extack)
183
+{
184
+ NL_SET_ERR_MSG(extack, "IPv6 support not enabled in kernel");
185
+ return -EAFNOSUPPORT;
186
+}
187
+
188
+static int eafnosupport_ip6_del_rt(struct net *net, struct fib6_info *rt,
189
+ bool skip_notify)
190
+{
191
+ return -EAFNOSUPPORT;
192
+}
193
+
194
+static int eafnosupport_ipv6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
195
+ int (*output)(struct net *, struct sock *, struct sk_buff *))
196
+{
197
+ kfree_skb(skb);
198
+ return -EAFNOSUPPORT;
199
+}
200
+
172201 const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
173202 .ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow,
203
+ .ipv6_route_input = eafnosupport_ipv6_route_input,
174204 .fib6_get_table = eafnosupport_fib6_get_table,
175205 .fib6_table_lookup = eafnosupport_fib6_table_lookup,
176206 .fib6_lookup = eafnosupport_fib6_lookup,
177
- .fib6_multipath_select = eafnosupport_fib6_multipath_select,
207
+ .fib6_select_path = eafnosupport_fib6_select_path,
178208 .ip6_mtu_from_fib6 = eafnosupport_ip6_mtu_from_fib6,
209
+ .fib6_nh_init = eafnosupport_fib6_nh_init,
210
+ .ip6_del_rt = eafnosupport_ip6_del_rt,
211
+ .ipv6_fragment = eafnosupport_ipv6_fragment,
179212 };
180213 EXPORT_SYMBOL_GPL(ipv6_stub);
181214