Bug 2219810

Summary: Missing extack in case of failure adding or removing an IPv6 address
Product: Red Hat Enterprise Linux 9 Reporter: Beniamino Galvani <bgalvani>
Component: kernelAssignee: Hangbin Liu <haliu>
kernel sub component: Networking QA Contact: Jianlin Shi <jishi>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: haliu, jiji, kzhang
Version: 9.3   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Beniamino Galvani 2023-07-05 12:43:38 UTC
Description of problem:

These functions:

  inet6_addr_add()
  ipv6_add_addr()
  inet6_addr_del()

don't set the extack in case of failure. In some situations, the extack would be useful for users to understand the problem without having to read kernel code.


Version-Release number of selected component (if applicable):
any version (tested on 6.2)


Actual results:
# ip addr add dev enp1s0 fd01::1/60 mngtmpaddr
RTNETLINK answers: Invalid argument

# echo 1 > /proc/sys/net/ipv6/conf/enp7s0/disable_ipv6
# ip addr add dev enp7s0 fd01::1
RTNETLINK answers: Permission denied

# ip addr del dev enp1s0 fd01::1234/64
RTNETLINK answers: Cannot assign requested address


Expected results:
Something like:
# ip addr add dev enp1s0 fd01::1/60 mngtmpaddr
Error: ipv6: addresses with mngtmpaddr flag must have prefix length 64

# echo 1 > /proc/sys/net/ipv6/conf/enp7s0/disable_ipv6
# ip addr add dev enp7s0 fd01::1
Error: ipv6: IPv6 is disabled on the interface

# ip addr del dev enp1s0 fd01::1234/64
Error: ipv6: address not found