netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thayne McCombs <astrothayne@gmail.com>
To: netdev@vger.kernel.org, stephen@networkplumber.org, vadim4j@gmail.com
Cc: Thayne McCombs <astrothayne@gmail.com>
Subject: [PATCH iproute2-next] ss: Add clarification about host conditions with multiple familes to man
Date: Mon,  1 Feb 2021 02:14:23 -0700	[thread overview]
Message-ID: <20210201091423.22737-1-astrothayne@gmail.com> (raw)
In-Reply-To: <20210128081018.9394-1-astrothayne@gmail.com>

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 <astrothayne@gmail.com>
---
 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 3da279f9..3c4beede 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 wildcord for either the address or port. The details for each family are as
-- 
2.30.0


  parent reply	other threads:[~2021-02-01  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  8:10 [PATCH] Add documentation of ss filter to man page Thayne McCombs
2021-01-31  6:16 ` Thayne McCombs
2021-02-01  9:14 ` Thayne McCombs [this message]
2021-02-02 22:25 ` Stephen Hemminger
2021-02-03  5:40   ` Thayne McCombs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210201091423.22737-1-astrothayne@gmail.com \
    --to=astrothayne@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vadim4j@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).