mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00
build: adjust for changed signature of ip_route_me_harder
(Cf. commit 46d6c5ae953cc0be38efd0e469284df7c4328cf8 in Linux.)
This commit is contained in:
@@ -41,6 +41,12 @@
|
|||||||
((const unsigned char *)&addr)[3]
|
((const unsigned char *)&addr)[3]
|
||||||
# define NIPQUAD_FMT "%hhu.%hhu.%hhu.%hhu"
|
# define NIPQUAD_FMT "%hhu.%hhu.%hhu.%hhu"
|
||||||
#endif
|
#endif
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) || \
|
||||||
|
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 9) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
|
||||||
|
#else
|
||||||
|
# define ip_route_me_harder(xnet, xsk, xskb, xaddrtype) ip_route_me_harder((xnet), (xskb), (xaddrtype))
|
||||||
|
# define ip6_route_me_harder(xnet, xsk, xskb) ip_route_me_harder((xnet), (xskb))
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline struct net *par_net(const struct xt_action_param *par)
|
static inline struct net *par_net(const struct xt_action_param *par)
|
||||||
{
|
{
|
||||||
|
@@ -121,8 +121,7 @@ static void delude_send_reset(struct net *net, struct sk_buff *oldskb,
|
|||||||
|
|
||||||
/* ip_route_me_harder expects skb->dst to be set */
|
/* ip_route_me_harder expects skb->dst to be set */
|
||||||
skb_dst_set(nskb, dst_clone(skb_dst(oldskb)));
|
skb_dst_set(nskb, dst_clone(skb_dst(oldskb)));
|
||||||
|
if (ip_route_me_harder(net, nskb->sk, nskb, addr_type))
|
||||||
if (ip_route_me_harder(net, nskb, addr_type))
|
|
||||||
goto free_nskb;
|
goto free_nskb;
|
||||||
else
|
else
|
||||||
niph = ip_hdr(nskb);
|
niph = ip_hdr(nskb);
|
||||||
|
@@ -191,8 +191,7 @@ echo_tg4(struct sk_buff *oldskb, const struct xt_action_param *par)
|
|||||||
|
|
||||||
/* ip_route_me_harder expects the skb's dst to be set */
|
/* ip_route_me_harder expects the skb's dst to be set */
|
||||||
skb_dst_set(newskb, dst_clone(skb_dst(oldskb)));
|
skb_dst_set(newskb, dst_clone(skb_dst(oldskb)));
|
||||||
|
if (ip_route_me_harder(par_net(par), newskb->sk, newskb, RTN_UNSPEC) != 0)
|
||||||
if (ip_route_me_harder(par_net(par), newskb, RTN_UNSPEC) != 0)
|
|
||||||
goto free_nskb;
|
goto free_nskb;
|
||||||
|
|
||||||
newip->ttl = ip4_dst_hoplimit(skb_dst(newskb));
|
newip->ttl = ip4_dst_hoplimit(skb_dst(newskb));
|
||||||
|
@@ -265,7 +265,7 @@ static void tarpit_tcp4(struct net *net, struct sk_buff *oldskb,
|
|||||||
#endif
|
#endif
|
||||||
addr_type = RTN_LOCAL;
|
addr_type = RTN_LOCAL;
|
||||||
|
|
||||||
if (ip_route_me_harder(net, nskb, addr_type))
|
if (ip_route_me_harder(net, nskb->sk, nskb, addr_type))
|
||||||
goto free_nskb;
|
goto free_nskb;
|
||||||
else
|
else
|
||||||
niph = ip_hdr(nskb);
|
niph = ip_hdr(nskb);
|
||||||
@@ -398,8 +398,7 @@ static void tarpit_tcp6(struct net *net, struct sk_buff *oldskb,
|
|||||||
&ipv6_hdr(nskb)->daddr, sizeof(struct tcphdr),
|
&ipv6_hdr(nskb)->daddr, sizeof(struct tcphdr),
|
||||||
IPPROTO_TCP,
|
IPPROTO_TCP,
|
||||||
csum_partial(tcph, sizeof(struct tcphdr), 0));
|
csum_partial(tcph, sizeof(struct tcphdr), 0));
|
||||||
|
if (ip6_route_me_harder(net, nskb->sk, nskb))
|
||||||
if (ip6_route_me_harder(net, nskb))
|
|
||||||
goto free_nskb;
|
goto free_nskb;
|
||||||
|
|
||||||
nskb->ip_summed = CHECKSUM_NONE;
|
nskb->ip_summed = CHECKSUM_NONE;
|
||||||
|
Reference in New Issue
Block a user