diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2022-09-16 11:34:28 +0800 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2022-09-22 16:12:33 -0700 |
commit | b264b4c6568c78a09475f1d6663e10e19d05abb4 (patch) | |
tree | 61a12efd5fc51b0cc6a1944fd434363dbb760690 /include | |
parent | 04a6b456bf7441b7d71b3f71428da82881486a0d (diff) | |
download | iproute2-b264b4c6568c78a09475f1d6663e10e19d05abb4.tar.gz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h index eeb23a64f..2eb80b3e4 100644 --- a/include/utils.h +++ b/include/utils.h @@ -36,6 +36,7 @@ extern int max_flush_loops; extern int batch_mode; extern int numeric; extern bool do_all; +extern int echo_request; #ifndef CONFDIR #define CONFDIR "/etc/iproute2" |