lkml.org 
[lkml]   [2003]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Reinjecting IP Packets
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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.054 / U:5.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site