Date: Sat, 28 Nov 1998 08:13:21 -0800 From: Mike Smith <mike@smith.net.au> To: Vladislav SAFRONOV <0824@08700000.mhs.rosmail.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Help! Modifying Linux sources to compile under 2.2.7R. Message-ID: <199811281613.IAA00945@dingo.cdrom.com> In-Reply-To: Your message of "Sun, 22 Nov 1998 23:41:10 %2B0300." <161BD2D781F0D57E%161BD2D781F0D57E@mhs.mhs.rosmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> I want to compile a little c program under Freebsd, but the source > warns: > > "Linux 2.0.33 source, will compile on BSD if you modify the ip > header etc." Sounds like you're trying to compile an exploit or an attack program. Bad, Bad boy. > I thought small tcp/ip applications could be copmiled under any Unix > :(, Linux is not Unix. > Well what should I modify? What's the difference between BSD ip > header and Linux ip header? Look at the structure definitions and work it out yourself; this is part of the learning process. See what gives you errors when you try to compile it; work out what it should do; fix it. > the source: > ... > struct iphdr *iph=(struct iphdr *)buf; > struct udphdr *udp=(struct udphdr *)(buf + 20); > ... > iph->version=4; > iph->ihl=5; > iph->tos=0; > iph->tot_len=htons(sizeof(buf)); > iph->id=htons(1234); > iph->frag_off=0; > iph->ttl=255; > iph->protocol=17; > > iph->saddr=inet_addr(SIP); > iph->daddr=resolve_address(argv[1]); > > Should I modify udp header as well? No, don't do that. If you get it wrong, you'll reverse the charge on all the electrons in the left half of your body. That would be bad. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811281613.IAA00945>