From alexey@kouznetsov.com  Wed Sep 24 13:18:45 2008
Return-Path: <alexey@kouznetsov.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D77031065683
	for <bug-followup@freebsd.org>; Wed, 24 Sep 2008 13:18:45 +0000 (UTC)
	(envelope-from alexey@kouznetsov.com)
Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.239])
	by mx1.freebsd.org (Postfix) with ESMTP id 83E2D8FC1D
	for <bug-followup@freebsd.org>; Wed, 24 Sep 2008 13:18:45 +0000 (UTC)
	(envelope-from alexey@kouznetsov.com)
Received: by qb-out-0506.google.com with SMTP id f30so1642968qba.35
        for <bug-followup@freebsd.org>; Wed, 24 Sep 2008 06:18:44 -0700 (PDT)
Received: by 10.86.79.19 with SMTP id c19mr7336473fgb.67.1222261267176;
        Wed, 24 Sep 2008 06:01:07 -0700 (PDT)
Received: from strelakuznec (nat-lg13-91-carp.order.hcn-strela.ru [91.192.68.113])
        by mx.google.com with ESMTPS id l12sm10814670fgb.6.2008.09.24.06.01.05
        (version=SSLv3 cipher=RC4-MD5);
        Wed, 24 Sep 2008 06:01:06 -0700 (PDT)
Message-Id: <AD986BE9FD0C4E9581C639234AB5D6A3@hcnstrela.ru>
Date: Wed, 24 Sep 2008 17:00:59 +0400
From: "Alexey Kouznetsov" <alexey@kouznetsov.com>
To: <pluknet@gmail.com>
Cc: <bug-followup@FreeBSD.org>
Subject: Re: port net-mgmt/ng_ipacct not build at current 7.1-PRERELEASE

>Number:         127610
>Category:       ports
>Synopsis:       Re: port net-mgmt/ng_ipacct not build at current 7.1-PRERELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 24 13:20:02 UTC 2008
>Closed-Date:    Wed Sep 24 14:43:05 UTC 2008
>Last-Modified:  Wed Sep 24 14:43:05 UTC 2008
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_0000_01C91E67.21C149B0
 Content-Type: text/plain;
 	charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 
 Hello!
 
 Thanks a lot!
 
 I have tried your patch. It works for me at test PC. I'll pit this in test
 on higt load place at weekend or start of next week.
 
 Also I have tried some simple Q&D solution
 --- ng_ipacct/ng_ipacct.c.orig	2008-09-18 11:11:05.000000000 +0400
 +++ ng_ipacct/ng_ipacct.c	2008-09-18 11:11:22.000000000 +0400
 @@ -902,7 +902,7 @@
  	int		i;
  
  	for (i = 0, ina = r->r_dst, port = r->r_dport; i < 2; i++) {
 -	    pcb = in_pcblookup_local(pcbinfo, ina, port, 1);
 +	    pcb = in_pcblookup_local(pcbinfo, ina, port, 1, NULL);
  	    if ((pcb != NULL) &&
  		(pcb->inp_laddr.s_addr == ina.s_addr)) {
  		break;
 
 (This is without any checkings for os version) and looks like it works in
 production (~30k pps) for 3 days right now.
 
 With best regards
 /Alexey
 -----Original Message-----
 From: pluknet [mailto:pluknet@gmail.com] 
 Sent: Saturday, September 20, 2008 3:54 PM
 To: bug-followup@FreeBSD.org; alexey@kouznetsov.com
 Subject: Re: port net-mgmt/ng_ipacct not build at current 7.1-PRERELEASE
 
 What about this patch?
 udp_output() does that, calling indirectly in_pcblookup_local().
 (I sent it 9/2 to maintainer without reply)
 
 $ cat patch-ng_ipacct.c
 --- ng_ipacct/ng_ipacct.c.orig	2006-12-05 23:46:04.000000000 +0300
 +++ ng_ipacct/ng_ipacct.c	2008-09-02 23:02:31.000000000 +0400
 @@ -41,6 +41,9 @@
  #include <sys/socketvar.h>
  #include <sys/ucred.h>
  #include <sys/sysctl.h>		/* XXX for udp_var.h */
 +#if __FreeBSD_version >= 700110
 +#include <sys/proc.h>
 +#endif
  #include <net/bpf.h>
  #include <net/ethernet.h>
  #include <net/route.h>
 @@ -898,11 +901,19 @@
  {
  	struct inpcb 	*pcb = NULL;
  	struct in_addr 	ina;
 +#if __FreeBSD_version >= 700110
 +	struct thread	*td = curthread;
 +#endif
  	u_short		port;
  	int		i;
 
  	for (i = 0, ina = r->r_dst, port = r->r_dport; i < 2; i++) {
 +/* close to in_pcblookup_local API change */
 +#if __FreeBSD_version >= 700110	
 +	    pcb = in_pcblookup_local(pcbinfo, ina, port, 1, td->td_ucred);
 +#else
  	    pcb = in_pcblookup_local(pcbinfo, ina, port, 1);
 +#endif
  	    if ((pcb != NULL) &&
  		(pcb->inp_laddr.s_addr == ina.s_addr)) {
  		break;
 --
 wbr,
 pluknet
 
 ------=_NextPart_000_0000_01C91E67.21C149B0--
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Sep 24 14:41:18 UTC 2008 
State-Changed-Why:  
Misfiled followup to ports/127437; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Sep 24 14:41:18 UTC 2008 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=127610 
>Unformatted:
