[PATCH 1/3] virarptable: Properly calculate rtattr length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use convenience macro from libnl3 which does almost the same thing we
were doing, but also aligns the payload length.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/util/virarptable.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virarptable.c b/src/util/virarptable.c
index 299dddd664ab..d8e41c5a8668 100644
--- a/src/util/virarptable.c
+++ b/src/util/virarptable.c
@@ -102,8 +102,7 @@ virArpTableGet(void)
             return table;
 
         VIR_WARNINGS_NO_CAST_ALIGN
-        parse_rtattr(tb, NDA_MAX, NDA_RTA(r),
-                     nh->nlmsg_len - NLMSG_LENGTH(sizeof(*r)));
+        parse_rtattr(tb, NDA_MAX, NDA_RTA(r), NLMSG_PAYLOAD(nh, sizeof(*r)));
         VIR_WARNINGS_RESET
 
         if (tb[NDA_DST] == NULL || tb[NDA_LLADDR] == NULL)
-- 
2.46.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux