From owner-freebsd-hackers Sat Nov 28 08:14:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA22717 for freebsd-hackers-outgoing; Sat, 28 Nov 1998 08:14:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (castles233.castles.com [208.214.165.233]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA22706 for ; Sat, 28 Nov 1998 08:14:51 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (LOCALHOST [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id IAA00945; Sat, 28 Nov 1998 08:13:22 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811281613.IAA00945@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 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. In-reply-to: Your message of "Sun, 22 Nov 1998 23:41:10 +0300." <161BD2D781F0D57E%161BD2D781F0D57E@mhs.mhs.rosmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 28 Nov 1998 08:13:21 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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