Commit Graph

1177 Commits

Author SHA1 Message Date
David Ahern
3c37c2d662 Update kernel headers
Update kernel headers to commit:
    cc7554954848 ("net: micrel: Change to receive timestamp in the frame for lan8841")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-06-21 09:13:05 -07:00
David Ahern
a120abc7f6 Update kernel headers
Update kernel headers to commit:
    ae91f7e436f8 ("net/pppoe: fix a typo for the PPPOE_HASH_BITS_1 definition")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-06-06 08:30:49 -06:00
Stephen Hemminger
957a3b16f0 libnetlink: drop unused rtnl_talk_iov
Function was defined but not used in current iproute2 code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-06-02 09:33:34 -07:00
Stephen Hemminger
ebe23249ce utils: make local cmdline functions static
No need to expose these parts of command line parsing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-06-02 09:33:34 -07:00
Stephen Hemminger
709063e836 ipaddress: accept symbolic names
The function rtnl_addproto_a2n() was defined but never used.
Use it to allow for symbolic names, and fix the function signatures
so protocol value is consistently __u8.

Fixes: bdb8d8549e ("ip: Support IP address protocol")
Cc: petrm@nvidia.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-06-02 08:51:53 -07:00
Stephen Hemminger
64b9f34280 uapi: update headers to 6.4-rc4
Minor addition to in.h

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-05-30 14:56:06 -07:00
Stephen Hemminger
1215e9d386 vxlan: make option printing more consistent
Add new helper function print_bool_opt() which prints
with no prefix and use it for vxlan options.

If the option matches the expected default value,
it is not printed if in non JSON mode unless the details
setting is repeated.

Use a table for the vxlan options. This will change
the order of the printing of options.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-05-30 12:32:22 -07:00
Stephen Hemminger
eb64e26835 uapi: add capability.h
All kernel header files should come from local copy of sanitized
headers, rather than relying on what Linux distribution ships.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-05-09 14:22:20 -07:00
Stephen Hemminger
30d98d1455 uapi: update kernel headers 6.4-rc1
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-05-08 13:41:31 -07:00
Stephen Hemminger
6f9bd171ff Merge git://git.kernel.org/pub/scm/network/iproute2/iproute2-next 2023-04-29 12:10:38 -07:00
Stephen Hemminger
1be3fcf0ab v6.3.0 2023-04-27 08:55:24 -07:00
Vladimir Oltean
1865a60871 utils: add max() definition
There is already a min() definition, add this below it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-04-24 19:42:21 -06:00
David Ahern
47928f8851 Update kernel headers
Update kernel headers to commit:
    fbc1449d385d ("Merge tag 'mlx5-updates-2023-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-04-22 10:03:31 -06:00
David Ahern
5dbb44707c Update kernel headers
Update kernel headers to commit:
    e28531143b25 ("net: ethernet: mtk_eth_soc: mtk_ppe: prefer newly added l2 flows")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-04-07 09:34:12 -06:00
Petr Machata
bdb8d8549e ip: Support IP address protocol
IPv4 and IPv6 addresses can be assigned a protocol value that indicates the
provenance of the IP address. The attribute is modeled after ip route
protocols, and essentially allows the administrator or userspace stack to
tag addresses in some way that makes sense to the actor in question.
Support for this feature was merged with commit 47f0bd503210 ("net: Add new
protocol attribute to IP addresses"), for kernel 5.18.

In this patch, add support for setting the protocol attribute at IP address
addition, replacement, and listing requests.

An example session with the feature in action:

	# ip address add dev d 192.0.2.1/28 proto 0xab
	# ip address show dev d
	26: d: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
	    link/ether 06:29:74:fd:1f:eb brd ff:ff:ff:ff:ff:ff
	    inet 192.0.2.1/28 scope global proto 0xab d
	       valid_lft forever preferred_lft forever

	# ip address replace dev d 192.0.2.1/28 proto 0x11
	# ip address show dev d
	26: d: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
	    link/ether 06:29:74:fd:1f:eb brd ff:ff:ff:ff:ff:ff
	    inet 192.0.2.1/28 scope global proto 0x11 d
	       valid_lft forever preferred_lft forever

A JSON dump. The protocol value is always provided as a string, even in
numeric mode, to provide a consistent interface.

	# ip -j address show dev d | jq
	[
	  {
	    "ifindex": 26,
	    "ifname": "d",
	    "flags": [
	      "BROADCAST",
	      "NOARP"
	    ],
	    "mtu": 1500,
	    "qdisc": "noop",
	    "operstate": "DOWN",
	    "group": "default",
	    "txqlen": 1000,
	    "link_type": "ether",
	    "address": "06:29:74:fd:1f:eb",
	    "broadcast": "ff:ff:ff:ff:ff:ff",
	    "addr_info": [
	      {
	        "family": "inet",
	        "local": "192.0.2.1",
	        "prefixlen": 28,
	        "scope": "global",
	        "protocol": "0x11",
	        "label": "d",
	        "valid_life_time": 4294967295,
	        "preferred_life_time": 4294967295
	      }
	    ]
	  }
	]

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-03-30 09:53:13 -06:00
David Ahern
88786cd1a9 Update kernel headers
Update kernel headers to commit:
    da617cd8d906 ("smsc911x: remove superfluous variable init")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-03-30 09:43:49 -06:00
David Ahern
d0d5eeff79 Update kernel headers
Update kernel headers to commit:
    fcb3a4653bc5 ("net/sched: act_api: use the correct TCA_ACT attributes in dump")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-03-23 09:45:31 -06:00
Stephen Hemminger
7b20400960 uapi: update headers from 6.3-rc2
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-03-18 19:16:31 -07:00
Stephen Hemminger
8f7c836f7a uapi: update license of fou.h
Upstream 6.2-rc2

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-03-12 19:47:48 -07:00
Stephen Hemminger
57c4038a0f uapi: update bpf.h from upstream
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-02-22 07:33:35 -08:00
David Ahern
a969883ddc Merge branch 'main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-02-22 08:22:19 -07:00
Stephen Hemminger
5d3df4657d v6.2.0 2023-02-20 09:44:47 -08:00
David Ahern
0b257557d8 Merge remote-tracking branch 'main/main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-02-18 10:03:08 -07:00
Stephen Hemminger
adae3cef28 uapi: update headers to 6.2-rc8
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-02-13 09:20:40 -08:00
David Ahern
94aeaf9cb1 Update kernel headers
Update kernel headers to commit:
    61d731e6538d ("Merge tag 'linux-can-next-for-6.3-20230206' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-02-07 09:09:29 -07:00
David Ahern
970884766f Update kernel headers
Update kernel headers to commit
    a7b87d2a31dc ("Merge branch 'mlxsw-add-support-of-latency-tlv'")

Signed-off-by: David Ahern <dsahern@kernel.org>
2023-01-22 10:56:46 -07:00
Stephen Hemminger
8d7c60b4dd uapi: update headers to 6.2-rc1
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-12-26 17:57:36 -08:00
David Ahern
3715a146e8 Merge branch 'main' into next
Conflicts:
	devlink/devlink.c

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-16 09:12:38 -07:00
Stephen Hemminger
83699d3d50 fix version # 2022-12-14 09:42:22 -08:00
David Ahern
3f1e064ea4 Update kernel headers
Update kernel headers to commit:
    7e68dd7d07a2 ("Merge tag 'net-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-14 08:54:03 -07:00
Stephen Hemminger
83de2e8005 v6.1.0 2022-12-12 16:11:57 -08:00
Ido Schimmel
fa94a97921 libnetlink: Fix wrong netlink header placement
The netlink header must be first in the netlink message, so move it
there.

Fixes: fee4a56f01 ("Update kernel headers")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-08 09:20:27 -07:00
David Ahern
fee4a56f01 Update kernel headers
Update kernel headers to commit:
    dbadae927287 ("tsnep: Rework RX buffer allocation")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-12-02 08:57:25 -07:00
Stephen Hemminger
7cd5c98343 uapi: update for in.h and ip.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-22 11:33:49 -08:00
David Ahern
bdfd292c31 Merge branch 'main' into next
Conflicts:
	include/uapi/linux/bpf.h

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-13 19:29:25 -07:00
David Ahern
e77c118d68 Update kernel headers
Update kernel headers to commit:
    bf46390f39c6 ("Merge branch 'genetlink-per-op-type-policies'")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-11-07 08:47:16 -07:00
Stephen Hemminger
cb2c7ff007 uapi: update from 6.1 pre rc1
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-10-11 07:17:52 -07:00
Stephen Hemminger
c43a935311 Merge branch 'merge' of ../iproute2-next 2022-10-11 07:14:19 -07:00
Stephen Hemminger
86ae36a70d v6.0.0 2022-10-04 08:17:15 -07:00
David Ahern
0ec3c138f9 Update kernel headers
Update kernel headers to commit:
    62c07983bef9 ("once: add DO_ONCE_SLOW() for sleepable contexts")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-03 08:42:41 -06:00
David Ahern
6781fcee42 Update kernel headers
Update kernel headers to commit:
    bc37b24ee05e ("Merge branch 'mlx5-xsk-updates-part3-2022-09-30'")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-10-02 16:45:25 -06:00
Stephen Hemminger
35ad983cc8 uapi: update of if_tun.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-09-30 12:35:48 -07:00
Hangbin Liu
6c09257f1b rtnetlink: add new function rtnl_echo_talk()
Add a new function rtnl_echo_talk() that could be used when the
sub-component supports NLM_F_ECHO flag. With this function we can
remove the redundant code added by commit b264b4c656 ("ip: add
NLM_F_ECHO support").

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-09-29 09:05:03 -06:00
Hangbin Liu
80059fa5c5 libnetlink: add offset for nl_dump_ext_ack_done
There is no rule to have an error code after NLMSG_DONE msg. The only reason
we has this offset is that kernel function netlink_dump_done() has an error
code followed by the netlink message header.

Making nl_dump_ext_ack_done() has an offset parameter. So we can adjust
this for NLMSG_DONE message without error code.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-09-27 21:18:49 -06:00
Hangbin Liu
b264b4c656 ip: add NLM_F_ECHO support
When user space configures the kernel with netlink messages, it can set the
NLM_F_ECHO flag to request the kernel to send the applied configuration back
to the caller. This allows user space to retrieve configuration information
that are filled by the kernel (either because these parameters can only be
set by the kernel or because user space let the kernel choose a default
value).

NLM_F_ACK is also supplied incase the kernel doesn't support NLM_F_ECHO
and we will wait for the reply forever. Just like the update in
iplink.c, which I plan to post a patch to kernel later.

A new parameter -echo is added when user want to get feedback from kernel.
e.g.

  # ip -echo addr add 192.168.0.1/24 dev eth1
  3: eth1    inet 192.168.0.1/24 scope global eth1
         valid_lft forever preferred_lft forever
  # ip -j -p -echo addr del 192.168.0.1/24 dev eth1
  [ {
          "deleted": true,
          "index": 3,
          "dev": "eth1",
          "family": "inet",
          "local": "192.168.0.1",
          "prefixlen": 24,
          "scope": "global",
          "label": "eth1",
          "valid_life_time": 4294967295,
          "preferred_life_time": 4294967295
      } ]

Suggested-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-09-22 16:12:33 -07:00
David Ahern
5e42ff10b1 Update kernel headers
Update kernel headers to commit:
    0140a7168f8b ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-09-22 15:50:08 -07:00
Stephen Hemminger
6d4e05c1fa uapi: update bpf and virtio_net
Update headers based on 6.0-rc6

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-09-20 15:58:41 -07:00
Jacob Keller
89afe6ef89 utils: extract CTRL_ATTR_MAXATTR and save it
mnlu_gen_socket_open opens a socket and configures it for use with a
generic netlink family. As part of this process it sends a
CTRL_CMD_GETFAMILY to get the ID for the family name requested.

In addition to the family id, this command reports a few other useful
values including the maximum attribute. The maximum attribute is useful in
order to know whether a given attribute is supported and for knowing the
necessary size to allocate for other operations such as policy dumping.

Since we already have to issue a CTRL_CMD_GETFAMILY to get the id, we can
also store the maximum attribute as well. Modify the callback functions to
parse the maximum attribute NLA and store it in the mnlu_gen_socket
structure.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
2022-08-31 20:59:03 -06:00
David Ahern
9137321df3 Update kernel headers
Update kernel headers to commit:
    cb45a8bf4693 ("net: axienet: Switch to 64-bit RX/TX statistics")

Signed-off-by: David Ahern <dsahern@kernel.org>
2022-08-31 20:42:52 -06:00
Stephen Hemminger
fb809cb373 uapi: update headers for xfrm and virtio_ring.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-08-31 09:37:13 -07:00