hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/net/netfilter/nft_tproxy.c
....@@ -88,9 +88,9 @@
8888 const struct nft_tproxy *priv = nft_expr_priv(expr);
8989 struct sk_buff *skb = pkt->skb;
9090 const struct ipv6hdr *iph = ipv6_hdr(skb);
91
- struct in6_addr taddr;
92
- int thoff = pkt->xt.thoff;
91
+ int thoff = nft_thoff(pkt);
9392 struct udphdr _hdr, *hp;
93
+ struct in6_addr taddr;
9494 __be16 tport = 0;
9595 struct sock *sk;
9696 int l4proto;
....@@ -289,6 +289,13 @@
289289 return 0;
290290 }
291291
292
+static int nft_tproxy_validate(const struct nft_ctx *ctx,
293
+ const struct nft_expr *expr,
294
+ const struct nft_data **data)
295
+{
296
+ return nft_chain_validate_hooks(ctx->chain, 1 << NF_INET_PRE_ROUTING);
297
+}
298
+
292299 static struct nft_expr_type nft_tproxy_type;
293300 static const struct nft_expr_ops nft_tproxy_ops = {
294301 .type = &nft_tproxy_type,
....@@ -296,6 +303,7 @@
296303 .eval = nft_tproxy_eval,
297304 .init = nft_tproxy_init,
298305 .dump = nft_tproxy_dump,
306
+ .validate = nft_tproxy_validate,
299307 };
300308
301309 static struct nft_expr_type nft_tproxy_type __read_mostly = {