From: Fernando Fernandez Mancera <fmancera@suse.de>
To: David Ahern <dsahern@kernel.org>, netdev@vger.kernel.org
Cc: stephen@networkplumber.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: Re: [PATCH iproute2-next] iplink: add support for setting IPv4 devconf parameters
Date: Tue, 2 Jun 2026 21:46:25 +0200 [thread overview]
Message-ID: <bc71f624-e4ce-47b7-9dae-13ad0db76ad1@suse.de> (raw)
In-Reply-To: <f97592a2-6690-4511-a98c-dacdeedf6516@kernel.org>
On 6/2/26 9:36 PM, David Ahern wrote:
> On 6/1/26 8:32 AM, Fernando Fernandez Mancera wrote:
>> Currently, modifying IPv4 interface configuration parameters requires
>> interacting with sysctl (/proc/sys/net/ipv4/conf/*). While
>> ip-netconf exists for monitoring these values, there has been no native
>> way to set them directly through iproute2.
>>
>> This patch introduces the support for that via 'inet' at the 'ip link
>> set'. It uses IFLA_INET_CONF netlink attribute to set the parameter.
>>
>> Example to enable forwarding on an interface:
>>
>> ip link set dev enp8s0 inet forwarding on
>
> If an attribute can be set this way, then ip link show needs to show the
> values. What's the plan on that front?
>
I could introduce it in a follow-up patch. I guess it makes sense to
introduce it for ip -d link show only, right? I am happy to work on it
anyway.
>>
>> Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
>> ---
>> ip/iplink.c | 354 ++++++++++++++++++++++++++++++++++++++++++
>> man/man8/ip-link.8.in | 81 ++++++++++
>> 2 files changed, 435 insertions(+)
>>
>
> ...
>
>> " [ gso_max_size BYTES ] [ gso_ipv4_max_size BYTES ] [ gso_max_segs PACKETS ]\n"
>> @@ -551,6 +569,339 @@ static int iplink_parse_vf(int vf, int *argcp, char ***argvp,
>> return 0;
>> }
>>
>> +static int iplink_parse_inet(int *argcp, char ***argvp, struct iplink_req *req)
>> +{
>> + struct rtattr *afs, *afinet, *inet_devconf;
>> + char **argv = *argvp;
>> + int argc = *argcp;
>> + int ret;
>> +
>> + afs = addattr_nest(&req->n, sizeof(*req), IFLA_AF_SPEC);
>> + afinet = addattr_nest(&req->n, sizeof(*req), AF_INET);
>> + inet_devconf = addattr_nest(&req->n, sizeof(*req), IFLA_INET_CONF);
>> +
>> + while (NEXT_ARG_OK()) {
>> + NEXT_ARG();
>> + if (matches(*argv, "forwarding") == 0) {
>
> new uses of matches are not allowed. If s/matches/strcmp/ is the only
> comment, I can fix up before applying.
>
Sorry I didn't know this. Thanks.
next prev parent reply other threads:[~2026-06-02 19:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 14:32 [PATCH iproute2-next] iplink: add support for setting IPv4 devconf parameters Fernando Fernandez Mancera
2026-06-02 19:36 ` David Ahern
2026-06-02 19:46 ` Fernando Fernandez Mancera [this message]
2026-06-02 21:11 ` David Ahern
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=bc71f624-e4ce-47b7-9dae-13ad0db76ad1@suse.de \
--to=fmancera@suse.de \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=stephen@networkplumber.org \
/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