From owner-freebsd-current@FreeBSD.ORG Tue May 29 23:40:32 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64532106564A; Tue, 29 May 2012 23:40:32 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 30F618FC0A; Tue, 29 May 2012 23:40:32 +0000 (UTC) Received: by dadv36 with SMTP id v36so6371433dad.13 for ; Tue, 29 May 2012 16:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=zPxqCPF5J0pd7R9fOWkzqkIGMiu1N0RMqH2mHIqr2B0=; b=kG3Wc+2TcphUnmlgbLtj0BCpFYhNpN2QevFQjoExkMPaCbJeDyph3yAc1QehIsF6tI yZs/tF+qfuRn7H/A9Jra3W6n/XStCJz3Px2a8XWRO+wlx+IgmlmlI+PevEQB0KMjidpz Oxzlx6iohoFvNU9JYkomxpfkeeaaNvVBH8imrjiyewgW3T7HdCZFGVGJ551a28hYdvdq j+D0o1q51n5sesbQvzudKl/VJiGM4+ANd/tpPVoohTMEPRh9WXLlCb3chpcO4oN52uGV APZYMtFUONM0SeggEhz07jGDYIjS5KR5PwygAxpNS7VnQSObCrVr1anbMLwUpTYzPvQr lddw== MIME-Version: 1.0 Received: by 10.68.200.193 with SMTP id ju1mr42586706pbc.90.1338334826116; Tue, 29 May 2012 16:40:26 -0700 (PDT) Received: by 10.68.2.74 with HTTP; Tue, 29 May 2012 16:40:26 -0700 (PDT) Date: Tue, 29 May 2012 16:40:26 -0700 Message-ID: From: Maksim Yevmenkin To: current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: syrinx@freebsd.org Subject: [patch] rfc: bsnmpd does not count ipv6 tcp connections in tcpCurrEstab X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 23:40:32 -0000 hello, any objections to the following patch? === Index: mibII_tcp.c =================================================================== --- mibII_tcp.c (revision 236265) +++ mibII_tcp.c (working copy) @@ -109,10 +109,12 @@ ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) { tp = (struct xtcpcb *)ptr; if (tp->xt_inp.inp_gencnt > xinpgen->xig_gen || - (tp->xt_inp.inp_vflag & INP_IPV4) == 0) + (tp->xt_inp.inp_vflag & (INP_IPV4|INP_IPV6)) == 0) continue; - tcp_total++; + if (tp->xt_inp.inp_vflag & INP_IPV4) + tcp_total++; + if (tp->xt_tp.t_state == TCPS_ESTABLISHED || tp->xt_tp.t_state == TCPS_CLOSE_WAIT) tcp_count++; === the idea is to return proper number of tcp connections (for both ipv4 and ipv6) in tcpCurrEstab. tcpConnTable will still return only ipv4 entries. thanks, max