From owner-svn-src-user@FreeBSD.ORG Mon Jan 11 17:35:34 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF2DA106568D; Mon, 11 Jan 2010 17:35:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE5FB8FC17; Mon, 11 Jan 2010 17:35:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BHZYLV028375; Mon, 11 Jan 2010 17:35:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHZY7k028373; Mon, 11 Jan 2010 17:35:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001111735.o0BHZY7k028373@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 11 Jan 2010 17:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202094 - user/luigi/ipfw3-head/sys/netinet/ipfw X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:35:35 -0000 Author: luigi Date: Mon Jan 11 17:35:34 2010 New Revision: 202094 URL: http://svn.freebsd.org/changeset/base/202094 Log: make dummynet consume packets correctly Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c Mon Jan 11 17:34:32 2010 (r202093) +++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c Mon Jan 11 17:35:34 2010 (r202094) @@ -799,8 +799,10 @@ dummynet_io(struct mbuf **m0, int dir, s goto dropit; } - if (sch_inst->kflags & DN_ACTIVE) + if (sch_inst->kflags & DN_ACTIVE) { + m = *m0 = NULL; /* consumed */ goto done; /* already active, nothing to do */ + } /* compute the initial allowance */ pipe = &sch->pipe; @@ -826,14 +828,14 @@ dummynet_io(struct mbuf **m0, int dir, s printf("dummynet: fast io: pkt chain detected!\n"); m->m_nextpkt = NULL; } + m = NULL; } else { *m0 = NULL; - /* XXX outside lock ? */ - if (m) - dummynet_send(m); } done: DUMMYNET_UNLOCK(); + if (m) + dummynet_send(m); return 0; dropit: