Thread (9 messages) 9 messages, 2 authors, 2018-10-06
STALE2797d

[PATCH iproute2 net-next v2 3/6] libnetlink: Add helper for getting a __s32 from netlink msgs

From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date: 2018-10-05 06:13:14
Subsystem: the rest · Maintainer: Linus Torvalds

From: Jesus Sanchez-Palencia <redacted>

This function retrieves a signed 32-bit integer from a netlink message
and returns it.

Signed-off-by: Jesus Sanchez-Palencia <redacted>
---
 include/libnetlink.h | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 88164975..79ba793e 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -185,6 +185,10 @@ static inline __u64 rta_getattr_u64(const struct rtattr *rta)
 	memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
 	return tmp;
 }
+static inline __s32 rta_getattr_s32(const struct rtattr *rta)
+{
+	return *(__s32 *)RTA_DATA(rta);
+}
 static inline __s64 rta_getattr_s64(const struct rtattr *rta)
 {
 	__s64 tmp;
-- 
2.19.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help