From owner-freebsd-net Fri Sep 11 06:05:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA29189 for freebsd-net-outgoing; Fri, 11 Sep 1998 06:05:29 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id GAA29184 for ; Fri, 11 Sep 1998 06:05:16 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id NAA19733; Fri, 11 Sep 1998 13:12:47 +0200 From: Luigi Rizzo Message-Id: <199809111112.NAA19733@labinfo.iet.unipi.it> Subject: PULLUP_TO in ip_fw.c To: net@FreeBSD.ORG Date: Fri, 11 Sep 1998 13:12:46 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ok, i adapted the ipfw code to bridged and non-ip packets, but there is one minor issue: the macro PULLUP_TO is defined as #define PULLUP_TO(len) do { \ if ((*m)->m_len < (len) \ && (*m = m_pullup(*m, (len))) == 0) { \ goto bogusfrag; \ } \ *pip = ip = mtod(*m, struct ip *); \ offset = (ip->ip_off & IP_OFFMASK); \ } while (0) and as such it requires that the mbuf starts with the ip header and always writes into *pip and ip. In my case, I might pass the firewall an mbuf which includes an ethernet header, and i make sure that m_pullup needs not to be called. So i'd like to change the macro to #define PULLUP_TO(len) do { \ if ((*m)->m_len < (len) ) { \ if (*m = m_pullup(*m, (len)) == 0) \ goto bogusfrag; \ *pip = ip = mtod(*m, struct ip *); \ offset = (ip->ip_off & IP_OFFMASK); \ } } while (0) which btw saves a few writes to variables in case m_pullup is not called. If there are no objections i am going to do this in the weekend (assuming our router will be fixed by then :( luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message