diff options
author | Petr Machata <petrm@nvidia.com> | 2023-03-21 12:51:59 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-23 08:32:52 +0000 |
commit | 5c4a9aa856c706def9239d1e43c4ea9fccb5c75a (patch) | |
tree | 3aad2809d41cd8a329b5a07315dad715a4622054 /net/ipv4/raw.c | |
parent | 90bf6610a133288f28941deae39ddb131ffbd3ed (diff) | |
download | linux-5c4a9aa856c706def9239d1e43c4ea9fccb5c75a.tar.gz |
net: ipv4: Allow changing IPv4 address protocol
When IP address protocol field was added in commit 47f0bd503210 ("net: Add
new protocol attribute to IP addresses"), the semantics included the
ability to change the protocol for IPv6 addresses, but not for IPv4
addresses. It seems this was not deliberate, but rather by accident.
A userspace that wants to change the protocol of an address might drop and
recreate the address, but that disrupts routing and is just impractical.
So in this patch, when an IPv4 address is replaced (through RTM_NEWADDR
request with NLM_F_REPLACE flag), update the proto at the address to the
one given in the request, or zero if none is given. This matches the
behavior of IPv6. Previously, any new value given was simply ignored.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
0 files changed, 0 insertions, 0 deletions