Bug 204593 - Add a sysctl to enable display of IPv4 ICMP handling in the kernel
Summary: Add a sysctl to enable display of IPv4 ICMP handling in the kernel
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-11-16 09:14 UTC by Hellmuth Michaelis
Modified: 2015-11-17 22:37 UTC (History)
2 users (show)

See Also:


Attachments
10.2-stable unified diff for /usr/src/sys/netinet/ip_icmp.c (3.86 KB, patch)
2015-11-16 09:14 UTC, Hellmuth Michaelis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hellmuth Michaelis 2015-11-16 09:14:02 UTC
Created attachment 163185 [details]
10.2-stable unified diff for /usr/src/sys/netinet/ip_icmp.c

Currently it only possible to follow IPv4 ICMP handling in/of the kernel by recompiling the kernel and adding a define for "ICMPPRINTFS" to enable kernel console messages for ICMP handling in /usr/src/sys/netinet/ip_icmp.c.

The attached patch converts this into a sysctl variable "net.inet.icmp.log_icmps" to enable/disable debugging output without recompilation.

As an add-on, the FIB number is displayed for rx'd/tx'd ICMP packets.
Comment 1 Andrey V. Elsukov freebsd_committer 2015-11-16 15:37:02 UTC
(In reply to Hellmuth Michaelis from comment #0)
> Currently it only possible to follow IPv4 ICMP handling in/of the kernel by
> recompiling the kernel and adding a define for "ICMPPRINTFS" to enable
> kernel console messages for ICMP handling in /usr/src/sys/netinet/ip_icmp.c.

You can get the most of these printfs using dtrace fbt probes.
To get more, I prefer add ICMP_PROBE() dtrace probe, similar to that we have for IP, UDP and TCP.