Commit Graph

6651 Commits

Author SHA1 Message Date
Stephen Hemminger
84c45b8acb Reapply "ss: prevent "Process" column from being printed unless requested"
This reverts commit f22c49730c.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-17 09:17:42 -08:00
Stephen Hemminger
dc517768cc uapi: update headers from 6.8-rc1
Removal of no longer used TC structs.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-15 09:39:36 -08:00
Stephen Hemminger
f22c49730c Revert "ss: prevent "Process" column from being printed unless requested"
This reverts commit 1607bf531f.

This commit is being reverted because it breaks output of tcp info.
The order of the columns enum is order sensistive.

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=218372
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-13 08:55:09 -08:00
Stephen Hemminger
5659cf7752 man: drop references to ifconfig
The documentation does not need to have any references to the
legacy command ifconfig.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-12 10:40:25 -08:00
Andrea Claudi
05a4fc7258 genl: ctrl.c: spelling fix in error message
Canot --> Cannot

Fixes: 65018ae43b ("This patch adds a generic netlink controller...")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-11 09:23:27 -08:00
Andrea Claudi
ba0d6e6d7d iplink_xstats: spelling fix in error message
Cannont --> Cannot

Fixes: 2b99748a60 ("add missing iplink_xstats.c")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-11 09:23:27 -08:00
David Ahern
97d3edd743 Merge remote-tracking branch 'main/main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
2024-01-08 19:25:43 +00:00
Stephen Hemminger
3dc3445bbf v6.7.0 2024-01-08 09:38:23 -08:00
Maks Mishin
a193733b7a lnstat: Fix deref of null in print_json() function
Now pointer `jw` is being checked for NULL before using
in function `jsonw_start_object`.
Added exit from function when `jw==NULL`.

Found by RASU JSC

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-08 09:31:51 -08:00
wenglianfa
3a882b6b4e rdma: Fix the error of accessing string variable outside the lifecycle
All these SPRINT_BUF(b) definitions are inside the 'if' block, but
accessed outside the 'if' block through the pointers 'comm'. This
leads to empty 'comm' attribute when querying resource information.
So move the definitions to the beginning of the functions to extend
their life cycle.

Before:
$ rdma res show srq
dev hns_0 srqn 0 type BASIC lqpn 18 pdn 5 pid 7775 comm

After:
$ rdma res show srq
dev hns_0 srqn 0 type BASIC lqpn 18 pdn 5 pid 7775 comm ib_send_bw

Fixes: 1808f002df ("lib/fs: fix memory leak in get_task_name()")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Acked-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-08 08:45:17 -08:00
Stephen Hemminger
45dc10463d remove support for iptables action
There is an open upstream kernel patch to remove ipt action from
kernel. This is corresponding iproute2 change.

 - Remove support fot ipt and xt in tc.
 - Remove no longer used header files.
 - Update man pages.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2024-01-08 01:44:50 +00:00
Stephen Hemminger
a903854bad rdma: do not mix newline and json object
Mixing the semantics of ending lines with the json object
leads to several bugs where json object is closed twice, etc.
Replace by breaking the meaning of newline() function into
two parts.

Now, lots of functions were taking the rdma data structure as
argument but never using it.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
27a477ba80 rdma: add oneline flag
Add oneline output format like other commands.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
6e0d4e91a5 rdma: make supress_errors a bit
Like other command line flags supress_errors can be a bit.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
f962b24a5a rdma: make pretty behave like other commands
For tc, ip, etc the -pretty flag only has meaning if json
is used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
22edc0cf37 rdma: use standard flag for json
The other iproute2 utils use variable json as flag.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
674e00aeab rdma: shorten print_ lines
With the shorter form of print_ function some of the lines can
now be shortened. Max line length in iproute2 should be 100 characters
or less.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:48:33 -08:00
Stephen Hemminger
43a0e300dd ip: merge duplicate if clauses
The code that handles brief option had two exactly matching
if (filter == AF_PACKET) clauses; merge them

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-03 16:30:26 -08:00
Eli Schwartz
48c969d49e configure: avoid un-recommended command substitution form
The use of backticks to surround commands instead of "$(cmd)" is a
legacy of the oldest pre-POSIX shells. It is confusing, unreliable, and
hard to read. Its use is not recommended in new programs.

Link: http://mywiki.wooledge.org/BashFAQ/082

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-01 11:00:32 -08:00
Stephen Hemminger
9b578bbade rdma: use print_XXX instead of COLOR_NONE
The rdma utility should be using same code pattern as rest of
iproute2. When printing, color should only be requested when
desired; if no color wanted, use the simpler print_XXX instead.

Fixes: b0a688a542 ("rdma: Rewrite custom JSON and prints logic to use common API")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-01 10:46:30 -08:00
Ido Schimmel
ff3e423b9c bridge: mdb: Add flush support
Implement MDB flush functionality, allowing user space to flush MDB
entries from the kernel according to provided parameters.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-30 14:26:19 -07:00
David Ahern
4be86f8e27 Update kernel headers
Update kernel headers to commit:
    92de776d2090 ("Merge tag 'mlx5-updates-2023-12-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-30 14:25:22 -07:00
Stephen Hemminger
8415b042f6 ip-link: use shorter URL to kernel docs
Use shorter URL (docs.kernel.org) so that manual entry does not
have too long a line. The debian troff checker would fail when
doing make check.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 10:21:51 -08:00
Benjamin Poirier
d205b5cf38 bridge: Provide rta_type()
Factor out the repeated code pattern
rta_type = attr->rta_type & NLA_TYPE_MASK
into a helper which is similar to the existing kernel function nla_type().

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:58:16 -08:00
Benjamin Poirier
1d73bfc8ab bridge: Deduplicate print_range()
The two implementations are now identical so keep only one instance and
move it to json_print.c where there are already a few other specialized
printing functions.

The string that's formatted in the "end" buffer is only needed when
outputting a range so move the snprintf() call within the condition.

The second argument's purpose is better conveyed by calling it "end" rather
than "id" so rename it.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:57:54 -08:00
Benjamin Poirier
dd4e1749a9 bridge: vni: Indent statistics with 2 spaces
`bridge -s vlan` indents statistics with 2 spaces compared to the vlan id
column while `bridge -s vni` indents them with 1 space. Change `bridge vni`
to match the behavior of `bridge vlan` since that second command predates
`bridge vni`.

Before:
$ bridge -s vni
dev               vni                group/remote
vxlan1            4001
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0
                  4002               10.0.0.1
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0
vxlan2            100
                   RX: bytes 0 pkts 0 drops 0 errors 0
                   TX: bytes 0 pkts 0 drops 0 errors 0

After:
$ bridge -s vni
dev               vni                group/remote
vxlan1            4001
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0
                  4002               10.0.0.1
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0
vxlan2            100
                    RX: bytes 0 pkts 0 drops 0 errors 0
                    TX: bytes 0 pkts 0 drops 0 errors 0

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
717f2f82f1 bridge: vni: Align output columns
Use fixed column widths to improve readability.

These changes are similar to commit e0c457b1a5 ("bridge: Align output
columns").

Before:
$ bridge vni
dev               vni              group/remote
vxlan1             4001
                   4002           10.0.0.1
                   5000-5010
                   16777214-16777215        10.0.0.2
vxlan2             100

After:
$ bridge vni
dev               vni                group/remote
vxlan1            4001
                  4002               10.0.0.1
                  5000-5010
                  16777214-16777215  10.0.0.2
vxlan2            100

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
562b208a7b bridge: vni: Remove unused argument in open_vni_port()
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
7d8509d84c bridge: vni: Replace open-coded instance of print_nl()
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
4f11b21e02 bridge: vni: Remove stray newlines after each interface
Currently, `bridge vni` outputs an empty line after each interface. This is
not consistent with the output style of other iproute2 commands, in
particular `bridge vlan`. Therefore, remove the empty lines.

If there are scripts that parse the normal text output of `bridge vni`,
those scripts might be broken by the removal of the empty lines. This is a
secondary concern because those scripts should consume the JSON output
instead.

Before:
$ bridge vni
dev               vni              group/remote
vxlan1             4001
                   5000-5010

vxlan2             100

$

After:
$ ./bridge/bridge vni
dev               vni              group/remote
vxlan1             4001
                   5000-5010
vxlan2             100
$

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
14c9845f05 bridge: vni: Reverse the logic in print_vnifilter_rtm()
print_vnifilter_rtm() is structured similarly to print_vlan_tunnel_info()
except that in the former, the open_vni_port() call is guarded by a "if
(first)" check whereas in the latter, the open_vlan_port() call is guarded
by a "if (!opened)" check.

Reverse the logic in one of the functions to have the same structure in
both. Since the calls being guarded are "open_...()", "close_...()", use
the "opened" logic structure.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
7418335b4b bridge: vni: Guard close_vni_port() call
Currently, the call to open_vni_port() within print_vnifilter_rtm() is
written in a way that is safe if there is a RTM_{NEW,DEL,GET}TUNNEL message
without any VXLAN_VNIFILTER_ENTRY attribute. However the close_vni_port()
call is written in a way that assumes there is always at least one
VXLAN_VNIFILTER_ENTRY attribute within every RTM_*TUNNEL message. At this
time, this assumption is correct. However, the code should be consistent in
its assumptions. Choose the safe approach and fix the asymmetry between the
open_vni_port() and close_vni_port() calls by guarding the latter call with
a check.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
b627c387eb bridge: vni: Move open_json_object() within print_vni()
print_vni() is used to output one vni or vni range which, in json output
mode, looks like
      {
        "vni": 100
      }

Currently, the closing bracket is handled within the function but the
opening bracket is handled by open_json_object() before calling the
function. For consistency, move the call to open_json_object() within
print_vni().

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
060eac10e7 bridge: vni: Remove print_vnifilter_rtm_filter()
print_vnifilter_rtm_filter() adds an unnecessary level of indirection so
remove it to simplify the code.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
0b8508f44d bridge: vlan: Remove paranoid check
To make the code lighter, remove the check on the actual print_range()
output width. In the odd case that an out-of-range, wide vlan id is
printed, printf() will treat the negative field width as positive and the
output will simply be further misaligned.

Suggested-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
cf7b528a21 bridge: vlan: Use printf() to avoid temporary buffer
Currently, print_vlan_tunnel_info() is first outputting a formatted string
to a temporary buffer in order to use print_string() which can handle json
or normal text mode. Since this specific string is only output in normal
text mode, by calling printf() directly, we can avoid the need to first
output to a temporary string buffer.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
58c8a08175 bridge: vni: Fix vni filter help strings
Add the missing 'vni' subcommand to the top level `bridge help`.
For `bridge vni { add | del } ...`, 'dev' is a mandatory argument.
For `bridge vni show`, 'dev' is an optional argument.

Fixes: 45cd32f9f7 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
aeb7ee2973 bridge: vni: Report duplicate vni argument using duparg()
When there is a duplicate 'vni' option, report the error using duparg()
instead of the generic invarg().

Before:
$ bridge vni add vni 100 vni 101 dev vxlan2
Error: argument "101" is wrong: duplicate vni

After:
$ ./bridge/bridge vni add vni 100 vni 101 dev vxlan2
Error: duplicate "vni": "101" is the second value.

Fixes: 45cd32f9f7 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
0b8c01b405 bridge: vni: Fix duplicate group and remote error messages
Consider the following command with a duplicated "remote" argument:
$ bridge vni add vni 150 remote 10.0.0.1 remote 10.0.0.2 dev vxlan2
Error: argument "remote" is wrong: duplicate group

The error message is misleading because there is no "group" argument. Both
of the "group" and "remote" options specify a destination address and are
mutually exclusive so change the variable name and error messages
accordingly.

The result is:
$ ./bridge/bridge vni add vni 150 remote 10.0.0.1 remote 10.0.0.2 dev vxlan2
Error: duplicate "destination": "10.0.0.2" is the second value.

Fixes: 45cd32f9f7 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
ba1e68f04b bridge: vni: Remove dead code in group argument parsing
is_addrtype_inet_not_multi(&daddr) may read an uninitialized "daddr". Even
if that is fixed, the error message that follows cannot be reached because
the situation would be caught by the previous test (group_present).
Therefore, remove this test on daddr.

Fixes: 45cd32f9f7 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Benjamin Poirier
e8177094d5 bridge: vni: Accept 'del' command
`bridge vni help` shows "bridge vni { add | del } ..." but currently
`bridge vni del ...` errors out unexpectedly:
	# bridge vni del
	Command "del" is unknown, try "bridge vni help".

Recognize 'del' as a synonym of the original 'delete' command.

Fixes: 45cd32f9f7 ("bridge: vxlan device vnifilter support")
Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:54:23 -08:00
Stephen Hemminger
a66a73af6d configure: drop test for ATM
The ATM qdisc was removed by:
commit 8a20feb638 ("tc: drop support for ATM qdisc")
but configure check was not removed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-22 09:26:59 -08:00
Phil Sutter
33f73690f1 man: Fix malformatted database file locations
The .BR macro does not put spaces in between its arguments. Also it will
apply to all arguments.

Fixes: 0a0a8f12fa ("Read configuration files from /etc and /usr")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-20 19:45:54 -08:00
Phil Sutter
aba8530da6 man: ip-route.8: Fix typo in rt_protos location spec
RTPROTO description erroneously specified /etc/iproute2/rt_protos twice.

Fixes: 0a0a8f12fa ("Read configuration files from /etc and /usr")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-20 19:45:11 -08:00
Guillaume Nault
ae447da649 ss: Add support for dumping TCP bound-inactive sockets.
Make ss aware of the new "bound-inactive" pseudo-state for TCP (see
Linux commit 91051f003948 ("tcp: Dump bound-only sockets in inet_diag.")).
These are TCP sockets that have been bound, but are neither listening nor
connecting.

With this patch, these sockets can now be dumped with:

  * the existing -a (--all) option, to dump all sockets, including
    bound-inactive ones,

  * the new -B (--bound-inactive) option, to dump them exclusively,

  * the new "bound-inactive" state, to be used in a STATE-FILTER.

Note that the SS_BOUND_INACTIVE state is a pseudo-state used for queries
only. The kernel returns them as SS_CLOSE.

The SS_NEW_SYN_RECV pseudo-state is added in this patch only because we
have to set its entry in the sstate_namel array (in scan_state()). Care
is taken not to make it visible by users.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-20 16:15:49 +00:00
Jiri Pirko
1a68525f46 mnl_utils: sanitize incoming netlink payload size in callbacks
Don't trust the kernel to send payload of certain size. Sanitize that by
checking the payload length in mnlu_cb_stop() and mnlu_cb_error() and
only access the payload if it is of required size.

Note that for mnlu_cb_stop(), this is happening already for example
with devlink resource. Kernel sends NLMSG_DONE with zero size payload.

Fixes: 049c58539f ("devlink: mnlg: Add support for extended ack")
Fixes: c934da8aaa ("devlink: mnlg: Catch returned error value of dumpit commands")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-08 09:30:11 -08:00
Stephen Hemminger
aed89de0e1 uapi: update stddef.h
Change from upstream 6.7-rc4

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-08 09:27:59 -08:00
Quentin Deslandes
1607bf531f ss: prevent "Process" column from being printed unless requested
Commit 5883c6eba5 ("ss: show header for --processes/-p") added
"Process" to the list of columns printed by ss. However, the "Process"
header is now printed even if --processes/-p is not used.

This change aims to fix this by moving the COL_PROC column ID to the same
index as the corresponding column structure in the columns array, and
enabling it if --processes/-p is used.

Fixes: 5883c6eba5 ("ss: show header for --processes/-p")
Signed-off-by: Quentin Deslandes <qde@naccy.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-12-06 09:41:09 -08:00
Geliang Tang
b6df01d177 ss: mptcp: print out subflows_total counter
A new counter mptcpi_subflows_total has been added in mptcpi_flags
to count the total amount of subflows from mptcp_info including the
initial one into kernel in this commit:

  6ebf6f90ab4a ("mptcp: add mptcpi_subflows_total counter")

This patch prints out this counter into mptcp_stats output.

Acked-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@linux.dev>
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-06 17:08:59 +00:00
David Ahern
7775a2306b Update kernel headers
Update kernel headers to commit:
    074ac38d5b95 ("octeontx2-af: cn10k: Increase outstanding LMTST transactions")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-06 17:08:17 +00:00