Date: Sun, 22 Nov 1998 23:37:07 +0300 From: Vladislav SAFRONOV <0824@08700000.mhs.rosmail.com> To: freebsd-net@FreeBSD.ORG Subject: Help! Modifying Linux sources to compile under 2.2.7R. Message-ID: <151BD2D781F0D57E%151BD2D781F0D57E@mhs.mhs.rosmail.com>
next 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."
I thought small tcp/ip applications could be copmiled under any Unix
:(,
Well what should I modify? What's the difference between BSD ip
header and Linux ip header?
...
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?
Sincerely,
Vlad Safronov
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?151BD2D781F0D57E%151BD2D781F0D57E>
