From owner-freebsd-net Wed Oct 18 9:31:30 2000 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 5F78D37B4C5; Wed, 18 Oct 2000 09:31:24 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.0/8.11.0) id e9IGV9979806; Wed, 18 Oct 2000 19:31:09 +0300 (EEST) (envelope-from ru) Date: Wed, 18 Oct 2000 19:31:09 +0300 From: Ruslan Ermilov To: Darren Reed Cc: net@FreeBSD.org Subject: IP Filter: small patch for FreeBSD re: ip_id Message-ID: <20001018193109.A78734@sunbay.com> Mail-Followup-To: Darren Reed , net@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Darren and -net! As you probably know, recent versions of FreeBSD do not byte-swap the ip_id IP header field from network to host byte order anymore. When I did that change, I have looked at what NetBSD has already done (I am talking about the IP Filter part re: the ip_id here), and just imported their patches (since I am not running the IPF personally and could not test). Today I was reviewing my modifications, and have found (I think) the place where the byte-swapping of ip_id became now in error. Can you please review the attached (tiny) patch? If you find this change right, please forward it to NetBSD as well. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: fil.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/fil.c,v retrieving revision 1.19 diff -u -p -r1.19 fil.c --- fil.c 2000/08/13 04:31:05 1.19 +++ fil.c 2000/10/18 16:08:57 @@ -825,12 +825,14 @@ int out; # endif #endif /* _KERNEL */ +#ifndef __FreeBSD__ /* * Be careful here: ip_id is in network byte order when called * from ip_output() */ if ((out) && (v == 4)) ip->ip_id = ntohs(ip->ip_id); +#endif changed = 0; fin->fin_v = v; @@ -1037,8 +1039,10 @@ logit: } #endif /* IPFILTER_LOG */ +#ifndef __FreeBSD__ if ((out) && (v == 4)) ip->ip_id = htons(ip->ip_id); +#endif #ifdef _KERNEL /* --9amGYk9869ThD9tj-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message