Skip to contentSkip to conversation

ip-addrlabel: Fix printing of label value

PATCH New Phil Sutter 1 participant 1 message Oct 16, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip-addrlabel: Fix printing of label value

Passing the return value of RTA_DATA() to rta_getattr_u32() is wrong since that function will call RTA_DATA() by itself already.

Fixes a7ad1c8a6845d ("ipaddrlabel: add json support")
---
 ip/ipaddrlabel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipaddrlabel.c +1 -1
index 2f79c56dcead2..8abe5722bafd1 100644
@@ -95,7 +95,7 @@ int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
 	}
 
 	if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(uint32_t)) {
-		uint32_t label = rta_getattr_u32(RTA_DATA(tb[IFAL_LABEL]));
+		uint32_t label = rta_getattr_u32(tb[IFAL_LABEL]);
 
 		print_uint(PRINT_ANY,
 			   "label", "label %u ", label);
Signature · 1 line
2.19.0