Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
route/addr: fix handling peer addresses for IPv4 addresses
For IPv4, a "normal" route has IFA_LOCAL and IFA_ADDRESS set to the same destination. An address with a explicit peer, has them differing. A peer of 0.0.0.0 is also valid and must be treated different from a normal address. unshare -n ip link add T type dummy ip link set T up ip addr add 192.168.5.10 peer 192.168.5.10/24 dev T ip addr add 192.168.5.10/24 dev T #RTNETLINK answers: File exists ip addr add 192.168.5.10 peer 192.168.6.10/24 dev T ip addr add 192.168.5.10 peer 0.0.0.0/24 dev T Previously, that would give: nl-addr-list #192.168.5.10/24 inet dev T scope global <permanent> #192.168.5.10 peer 192.168.6.10/24 inet dev T scope global <permanent> #192.168.5.10/24 inet dev T scope global <permanent> With this change, we properly get: nl-addr-list #192.168.5.10/24 inet dev T scope global <permanent> #192.168.5.10/24 peer 192.168.6.10 inet dev T scope global <permanent> #192.168.5.10/24 peer 0.0.0.0 inet dev T scope global <permanent> http://lists.infradead.org/pipermail/libnl/2016-June/002157.html Signed-off-by: Thomas Haller <thaller@redhat.com>
- Loading branch information