From owner-freebsd-stable Tue Jul 2 04:14:59 1996 Return-Path: owner-stable Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA29168 for stable-outgoing; Tue, 2 Jul 1996 04:14:59 -0700 (PDT) Received: from robin.camelot.de (root@robin.camelot.de [194.97.87.3]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id EAA29163 for ; Tue, 2 Jul 1996 04:14:55 -0700 (PDT) Received: from lancelot.camelot.de(really [194.97.87.4]) by camelot.de via sendmail with smtp id for ; Sat, 29 Jun 96 17:30:07 +0200 (MET DST) (/\##/\ Smail3.1.30.13 #30.3 built 25-mar-96) Received: from jelal.hb.north.de by camelot.de via rmail with uucp id for FreeBSD.org!stable; Sat, 29 Jun 96 17:30:03 +0200 (MET DST) (/\##/\ Smail3.1.30.13 #30.3 built 25-mar-96) Received: by jelal.hb.north.de (SMail-ST 0.95gcc/2.5+) id AA00131; Sat, 29 Jun 1996 17:19:28 +0100 (CET) Received: (from nox@localhost) by saturn.hb.north.de (8.7.5/8.7.3) id RAA00434; Sat, 29 Jun 1996 17:13:45 +0200 (MET DST) From: Juergen Lock Message-Id: <199606291513.RAA00434@saturn.hb.north.de> Subject: Re: ipfw (was: Re: lockups.) To: alex@fa.tdktca.com (Alex Nash) Date: Sat, 29 Jun 1996 17:13:44 +0200 (MET DST) Cc: davidg@Root.COM, jhay@mikom.csir.co.za, nasim!FreeBSD.org!stable@jelal.hb.north.de In-Reply-To: <31D446BA.9BDE134@fa.tdktca.com> from Alex Nash at "Jun 28, 96 03:55:22 pm" X-Mailer: ELM [version 2.4ME+ PL19 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-stable@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Alex Nash writes: > > > Nifty trick, I like it. I just wanted to point out one thing: this > > > is only necessary if you plan to boot kernels supped before Feb 23, > > > not 0696. > > > > Umm you are thinking of -current maybe? :) or my -stable must have > > had an, errm, interesting problem for quite a while now... > > > > actually no (thanks cvs :), looks like current is also affected: > > You mean -stable. Yes, as of Monday this week, -current and -stable > are in sync. Actually i was talking about the (date of the) struct ip_fw change, but nevermind. > As far as accepting both versions: getting the new kernel to accept > the old struct would be fairly easy, the new ip_fw struct has some > extensions and two new flags, all easily defaulted. like... below? :) > > Alex ATB, Juergen Index: /www/usr/home/cvs/src/src/sys/netinet/ip_fw.c =================================================================== RCS file: /home/cvs/cvs/src/sys/netinet/ip_fw.c,v retrieving revision 1.14.4.9 diff -u -r1.14.4.9 ip_fw.c --- ip_fw.c 1996/06/25 03:16:41 1.14.4.9 +++ ip_fw.c 1996/06/29 14:58:29 @@ -600,14 +600,31 @@ { struct ip_fw *frwl; - if (m->m_len != sizeof(struct ip_fw)) { - dprintf(("ip_fw_ctl: len=%d, want %d\n", m->m_len, - sizeof(struct ip_fw))); - return (NULL); + static struct ip_fw ftmp64; + static int warned; + int f_mask = ~IP_FW_F_MASK; + + /* backward compatibility hack for older ipfw(8)... */ + if (m->m_len == 64 && sizeof(struct ip_fw) == 100) { + frwl = mtod(m, struct ip_fw *); + bcopy(frwl, &ftmp64, (size_t)64); + frwl = &ftmp64; + /* old IP_FW_F_MASK */ + f_mask = ~0xfff; + if (!warned) { + dprintf(("ip_fw_ctl: old format ip_fw struct (converted), need to update ipfw(8)?\n")); + ++warned; + } + } else { + if (m->m_len != sizeof(struct ip_fw)) { + dprintf(("ip_fw_ctl: len=%d, want %d\n", m->m_len, + sizeof(struct ip_fw))); + return (NULL); + } + frwl = mtod(m, struct ip_fw *); } - frwl = mtod(m, struct ip_fw *); - if ((frwl->fw_flg & ~IP_FW_F_MASK) != 0) { + if ((frwl->fw_flg & f_mask) != 0) { dprintf(("ip_fw_ctl: undefined flag bits set (flags=%x)\n", frwl->fw_flg)); return (NULL);