From patchwork Tue Jul 16 15:59:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Kondratiev X-Patchwork-Id: 259444 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9DCDB2C013F for ; Wed, 17 Jul 2013 01:59:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933428Ab3GPP7l (ORCPT ); Tue, 16 Jul 2013 11:59:41 -0400 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:33150 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932441Ab3GPP7j (ORCPT ); Tue, 16 Jul 2013 11:59:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1373990379; x=1405526379; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bgvJeJSmq7lY/ZWM41hQYMgOaQFUsD6Hganm5v3eo0o=; b=shb7iNSpAFeLRJjo82tk4luo9kGPFvMiQQpE8hU+wLHh8Tra/REITWTt jrXCichT1o+/i8BhVoPJtpyUHPt1so0rvb29BWYIeIz3KpLrpczZzasaG xAt/PZWmhyH49HPxpGfsj+SulMKkZaOISSMghw2cCxZcVzOeiW7EVMyVF 0=; X-IronPort-AV: E=Sophos;i="4.89,677,1367996400"; d="scan'208";a="47604842" Received: from ironmsg01-lv.qualcomm.com ([10.47.202.180]) by sabertooth02.qualcomm.com with ESMTP; 16 Jul 2013 08:59:39 -0700 Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 16 Jul 2013 08:59:38 -0700 Received: from lx-vladimir.localnet (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.2.318.4; Tue, 16 Jul 2013 08:59:38 -0700 From: Vladimir Kondratiev To: Daniel Borkmann CC: , Jiri Pirko Subject: Re: [patch net-next v2] nlmon: use standard rtnetlink link api for add/del devices Date: Tue, 16 Jul 2013 18:59:36 +0300 Message-ID: <1561418.Jq9drZzso6@lx-vladimir> Organization: Qualcomm Atheros User-Agent: KMail/4.10.4 (Linux/3.8.0-26-generic; KDE/4.10.4; x86_64; ; ) In-Reply-To: <51E55D91.5050000@redhat.com> References: <1372755331-1267-1-git-send-email-jiri@resnulli.us> <51E55D91.5050000@redhat.com> MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tuesday, July 16, 2013 04:49:53 PM Daniel Borkmann wrote: > On 07/16/2013 04:08 PM, Vladimir Kondratiev wrote: > > Jiri Pirko resnulli.us> writes: > > > >> It is not nice when netdev is created right after module load and with > >> some implicit name. So rather change nlmon to use standard rtnl link API. > > > > Could you please elaborate a bit - how to capture netlink skb's after your > > patch? Before, it was netdev that may be used with tcpdump. Now, there is > > no such netdev. How to create it? > > modprobe nlmon > ip link add type nlmon > ip link set nlmon0 up > > tcpdump -i nlmon0 .... > > ip link set nlmon0 down > ip link del dev nlmon0 > rmmod nlmon Thanks a lot! I guess it is worth to have this mentioned somewhere. It will save lots of questions. For example, in Kconfig: --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index b45b240..13acea2 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -247,8 +247,18 @@ config NLMON purpose of this is to analyze netlink messages with packet sockets. Thus applications like tcpdump will be able to see local netlink messages if they tap into the netlink device, record pcaps for further - diagnostics, etc. This is mostly intended for developers or support - to debug netlink issues. If unsure, say N. + diagnostics, etc. Typical flow is: + + modprobe nlmon + ip link add type nlmon + ip link set nlmon0 up + tcpdump -i nlmon0 .... + ip link set nlmon0 down + ip link del dev nlmon0 + rmmod nlmon + + This is mostly intended for developers or support to debug netlink + issues. If unsure, say N. endif # NET_CORE