build: adjust for changed signature of ip_route_me_harder

(Cf. commit 46d6c5ae953cc0be38efd0e469284df7c4328cf8 in Linux.)
This commit is contained in:
Jan Engelhardt
2020-11-19 12:28:55 +01:00
parent d3f7dc1f55
commit 0ab3247900
4 changed files with 10 additions and 7 deletions

View File

@@ -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)
{ {

View File

@@ -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);

View File

@@ -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));

View File

@@ -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;