On Thursday 04 of March 2004 10:05, cieciwa wrote:
> removed TARPIT this patch required linux < 2.6.0 !!!!!!!!!!
oryginalny tak, ale go przerobilem pod struktury kernela 2.6
i mialem testowac jak tylko mi sie uda zbudowac iptables...
--
If you think of MS-DOS as mono, and Windows as stereo,
then Linux is Dolby Digital and all the music is free...
--- ipt_TARPIT.c.orig 2004-03-04 02:19:06.000000000 +0100
+++ ipt_TARPIT.c 2004-03-04 03:25:12.000000000 +0100
@@ -84,6 +84,7 @@
struct tcphdr *otcph, *ntcph;
unsigned int otcplen;
u_int16_t tmp;
+ struct flowi fl = {};
/* A truncated TCP header isn't going to be useful */
if (oskb->len < (oskb->nh.iph->ihl*4) + sizeof(struct tcphdr))
@@ -179,17 +180,18 @@
nskb->nh.iph->check = ip_fast_csum((unsigned char *)nskb->nh.iph,
nskb->nh.iph->ihl);
- if (ip_route_output(&nrt, nskb->nh.iph->daddr,
- local ? nskb->nh.iph->saddr : 0,
- RT_TOS(nskb->nh.iph->tos) | RTO_CONN,
- 0) != 0)
+ fl.nl_u.ip4_u.daddr = nskb->nh.iph->daddr;
+ fl.nl_u.ip4_u.saddr = (local ? nskb->nh.iph->saddr : 0);
+ fl.nl_u.ip4_u.tos = RT_TOS(nskb->nh.iph->tos) | RTO_CONN;
+ fl.oif = 0;
+ if (ip_route_output_key(&nrt, &fl) != 0)
goto free_nskb;
dst_release(nskb->dst);
nskb->dst = &nrt->u.dst;
/* "Never happens" */
- if (nskb->len > nskb->dst->pmtu)
+ if (nskb->len > dst_pmtu(nskb->dst))
goto free_nskb;
ip_direct_send (nskb);
@@ -264,8 +266,12 @@
return 1;
}
-static struct ipt_target ipt_tarpit_reg
-= { { NULL, NULL }, "TARPIT", tarpit, check, NULL, THIS_MODULE };
+static struct ipt_target ipt_tarpit_reg = {
+ .name = "TARPIT",
+ .target = tarpit,
+ .checkentry = check,
+ .me = THIS_MODULE
+};
static int __init init(void)
{
__________________________________________________________
nie pytaj co inni zrobili dla pld, pomysl ile sam zrobiles