From 38957a2f6c3ec2f69c8c444c77c3cafc296e23f1 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Tue, 2 Feb 2021 14:30:40 -0800 Subject: [PATCH] ss: Add clarification about host conditions with multiple familes to man In creating documentation for expressions I ran into an interesting case where if you use two different familie types in the expression, such as in `ss 'sport inet:ssh or src unix:/run/*'`, then you would only get the results for one address family (in this case unix sockets). The reason is that in parse_hostcond if the family is specified we remove any previously added families from filter->families, and preserve the "states" if any states are set. I tried changing this to not reset the families, but ran into some issues with Invalid Argument errors in inet_show_netlink, I think related to the state. I can dig into that more if supporting this is useful, but I'm not sure if these types of expressions would actually be useful in practice. Or perhaps an error should be given if an expression contains conditions with multiple families (besides inet and inet6)? Anyway, for now, this patch just notes the limitation in the man page. Signed-off-by: Thayne McCombs Signed-off-by: Stephen Hemminger --- man/man8/ss.8 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/man8/ss.8 b/man/man8/ss.8 index bcb0feee..42aac6de 100644 --- a/man/man8/ss.8 +++ b/man/man8/ss.8 @@ -511,7 +511,9 @@ The general host syntax is [FAMILY:]ADDRESS[:PORT]. .P FAMILY must be one of the families supported by the -f option. If not given it defaults to the family given with the -f option, and if that is also -missing, will assume either inet or inet6. +missing, will assume either inet or inet6. Note that all host conditions in the +expression should either all be the same family or be only inet and inet6. If there +is some other mixture of families, the results will probably be unexpected. .P The form of ADDRESS and PORT depends on the family used. "*" can be used as a wildcard for either the address or port. The details for each family are as -- 2.39.5