mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 06:43:16 +00:00
zebra: fix routing socket AF_LINK handling on NETMASK
IPv6 netmasks use AF_LINK family type and puts the correct amount of
set bits in the data structure. If we only copy the SDL header we
won't get all IPv6 address length, we must copy the whole extension of
the `sockaddr_in6` struct (which is provided in `destlen` parameter).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 691e903879
)
This commit is contained in:
parent
b04f70c1b8
commit
e0f741f466
@ -274,7 +274,7 @@ size_t _rta_get(caddr_t sap, void *destp, size_t destlen, bool checkaf)
|
||||
if (sa->sa_family == AF_LINK) {
|
||||
sdl = (struct sockaddr_dl *)sa;
|
||||
if (sdl->sdl_index == 0 || sdl->sdl_nlen == 0)
|
||||
copylen = sizeof(*sdl) - sizeof(sdl->sdl_data);
|
||||
copylen = destlen;
|
||||
}
|
||||
|
||||
if (copylen > destlen) {
|
||||
|
Loading…
Reference in New Issue
Block a user