This is useful for iterating elements in a nested attribute,
if they're not parsed with a strict length limit or such.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David Ahern <dsahern@gmail.com>
* messages from dump file */
#define NLMSG_TSTAMP 15
+#define rtattr_for_each_nested(attr, nest) \
+ for ((attr) = (void *)RTA_DATA(nest); \
+ RTA_OK(attr, RTA_PAYLOAD(nest) - ((char *)(attr) - (char *)RTA_DATA((nest)))); \
+ (attr) = RTA_TAIL((attr)))
+
#endif /* __LIBNETLINK_H__ */