From owner-freebsd-net@freebsd.org Thu May 3 21:32:45 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF574FBB9A9; Thu, 3 May 2018 21:32:45 +0000 (UTC) (envelope-from dieterbsd@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65E8D68F2B; Thu, 3 May 2018 21:32:45 +0000 (UTC) (envelope-from dieterbsd@gmail.com) Received: by mail-it0-x244.google.com with SMTP id 70-v6so1090744ity.2; Thu, 03 May 2018 14:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=XxLfZ7Zbn9+l4GkAhiCJr95bEI5408ZqfU+DiQY8wLw=; b=tW6srtrgqSWLdyHJqk76znaojXNMwkdrpI6ql/mHAp+mVU550oaLwGgGyVoyjx0WCm qtkD3PLr9Q112RkVEwNGM970QSU4ebjeg88qNetm9SM4GR4d0WZCgzl+TBQHr1QJ6GeF bz11gChqmSql7pPXG+9ANzBUCS8qjYXhtef56NVqjaFHJMZPRYanP0I+uBlJLEaNpbRz vfYSVEGdHzQPY+VX+hvT08giAmpRdJ0xpdn5UrztrwzuJv3YnfY+vv98JGhOz3p9ZObk X8VaAFVxBdGr4VJkrhlQ9gvB9NXuN1ZyS6izzCWOmxMvTkHtVDs8yBlHY6FHGiinPJce yFnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=XxLfZ7Zbn9+l4GkAhiCJr95bEI5408ZqfU+DiQY8wLw=; b=N2Rejwb00giCp3KDpw68x6+55tf1S7TpB0Uz5rDOAIragYt8X0oZSJmaE0LKuUVega KFeeO2BcGSVylnbipTp8DxCmQsslh4aOEdMQswIMqi0Wt5rrwI/T7lU3WDYYJoRw4qkw B6PKTXG4lIq0eZtu3vChjylQWDDkbleFlKhIfLU45forkZHVjfjAnZacFthG1NKLVNM7 jWG1TuuIH2rVBbzgHSFvF4bFfrripkizIooZcmZtitdaDRs28C/AMR+TH0BMrUY9PF5A ytD8BpHhReaAibYulK1TvG3Y42WquuORG3YlCyghuceiUfvjPPx3b+GOfa/J/s4S+HwI PtIQ== X-Gm-Message-State: ALQs6tCVLoIW9rN7wu4f6qa2/P09OXZ3H5wjGvlEH6fDoqgC/Xph1her 2QI4Oe+M3UGsBBn7zMuMuRw0Z+3JuzV8B8JYYnc= X-Google-Smtp-Source: AB8JxZpMJiTUOcUeHFjzXfPOm6lOdl8CV2L+zeEgBbtaSv8EjPCo99uVoclJW+BhQ7CErYiDugxWXtlvkfSVfd02pD8= X-Received: by 2002:a24:c4c1:: with SMTP id v184-v6mr21787919itf.41.1525383164719; Thu, 03 May 2018 14:32:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.192.131.43 with HTTP; Thu, 3 May 2018 14:32:44 -0700 (PDT) From: Dieter BSD Date: Thu, 3 May 2018 14:32:44 -0700 Message-ID: Subject: netstat(1) -s -f is broken To: freebsd-net@freebsd.org Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 21:32:46 -0000 FreeBSD 10.3-RELEASE The fine man page promises: netstat -i | -I interface -s [-46] [-f protocol_family | -p protocol] [-M core] [-N system] Display per-interface statistics for each network protocol, for a particular protocol_family, or for a single protocol. But in reality, netstat -I interface -s -f family only works if family is inet6. interface=lo0 for fam in inet inet6 pfkey atalk netgraph ipx unix link do echo -n interface = $interface fam = $fam netstat -I $interface -s -f $fam | wc done interface = lo0 fam = inet 0 0 0 interface = lo0 fam = inet6 56 258 1728 interface = lo0 fam = pfkey 0 0 0 interface = lo0 fam = atalk 0 0 0 interface = lo0 fam = netgraph 0 0 0 interface = lo0 fam = ipx 0 0 0 interface = lo0 fam = unix 0 0 0 interface = lo0 fam = link 0 0 0 I had this in a loop with all the interfaces, the results are the same for all interfaces. Doesn't work with -p either. netstat -I lo0 -s -p udp :udp: no per-interface stats routine It would be very useful if this actually worked.