aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.c
diff options
context:
space:
mode:
authorJohn Rutherford <john.rutherford@dektech.com.au>2019-08-07 12:52:29 +1000
committerDavid S. Miller <davem@davemloft.net>2019-08-08 22:11:39 -0700
commit6c9081a3915dc0782a8f1424343b794f2cf53d9c (patch)
treef4f751d693daadfe7794648c529958b1da1b7b5b /net/tipc/core.c
parentMerge branch 'flow_offload-add-indr-block-in-nf_table_offload' (diff)
downloadlinux-dev-6c9081a3915dc0782a8f1424343b794f2cf53d9c.tar.xz
linux-dev-6c9081a3915dc0782a8f1424343b794f2cf53d9c.zip
tipc: add loopback device tracking
Since node internal messages are passed directly to the socket, it is not possible to observe those messages via tcpdump or wireshark. We now remedy this by making it possible to clone such messages and send the clones to the loopback interface. The clones are dropped at reception and have no functional role except making the traffic visible. The feature is enabled if network taps are active for the loopback device. pcap filtering restrictions require the messages to be presented to the receiving side of the loopback device. v3 - Function dev_nit_active used to check for network taps. - Procedure netif_rx_ni used to send cloned messages to loopback device. Signed-off-by: John Rutherford <john.rutherford@dektech.com.au> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r--net/tipc/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index c8370722f0bb..23cb379a93d6 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -82,6 +82,10 @@ static int __net_init tipc_init_net(struct net *net)
if (err)
goto out_bclink;
+ err = tipc_attach_loopback(net);
+ if (err)
+ goto out_bclink;
+
return 0;
out_bclink:
@@ -94,6 +98,7 @@ out_sk_rht:
static void __net_exit tipc_exit_net(struct net *net)
{
+ tipc_detach_loopback(net);
tipc_net_stop(net);
tipc_bcast_stop(net);
tipc_nametbl_stop(net);