Re: Reinjecting IP Packets

Richard B. Johnson
2003-08-22T16:53:36Z

On Fri, 22 Aug 2003, Patrick Sodre Carlos wrote:

>
> My mistake... I forgot to mention that the packet will be coming from
> user-space.
>
> Patrick

Then just use raw packets. Find the source of 'ping' and send
packets just like it does...

ld->icp.net.icmp_id = ld->ident;
ld->icp.net.icmp_cksum = 0;
ld->icp.net.icmp_cksum = chksum(&ld->icp, len);
if(sendto(ld->s, &ld->icp, len, 0, &ld->where, sizeof(ld->where)) != len)
perror("ping: sendto");
}

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.