diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-08-23 09:34:44 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-08-23 09:34:44 +0200 |
commit | 5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b (patch) | |
tree | 9d055e83926da4c70ac57cdab427e33370df15d4 /netlink.c | |
parent | 69303cafbef86ef070d67582169d455eb8da288c (diff) | |
download | passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar.gz passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar.bz2 passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar.lz passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar.xz passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.tar.zst passt-5e4f7b92b0b0bf4724c505fa95fcae1526a8f88b.zip |
netlink: Set IFA_ADDRESS, not just IFA_LOCAL, while adding IPv4 addresses
Otherwise, we actually configure the address, but it's not usable
because no local route is added by the kernel.
Link: https://github.com/containers/podman/pull/19699
Fixes: cfe7509e5c16 ("netlink: Use struct in_addr for IPv4 addresses, not bare uint32_t")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'netlink.c')
-rw-r--r-- | netlink.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -629,6 +629,7 @@ int nl_addr_set(int s, unsigned int ifi, sa_family_t af, memcpy(&req.set.a4.l, addr, sizeof(req.set.a4.l)); req.set.a4.rta_l.rta_len = rta_len; req.set.a4.rta_l.rta_type = IFA_LOCAL; + memcpy(&req.set.a4.a, addr, sizeof(req.set.a4.a)); req.set.a4.rta_a.rta_len = rta_len; req.set.a4.rta_a.rta_type = IFA_ADDRESS; } |