[libmnl,1/3] examples: fix neigh max attributes
diff mbox series

Message ID 20180521171211.5mybck3yj3tfy7qx@nevthink
State Accepted
Delegated to: Pablo Neira
Headers show
Series
  • examples: rtnl neigh dump cleanups
Related show

Commit Message

Laura Garcia Liebana May 21, 2018, 5:12 p.m. UTC
Use NDA_MAX for neigh maximum attributes instead of IFA_MAX,
which is only for interfaces.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
 examples/rtnl/rtnl-neigh-dump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/examples/rtnl/rtnl-neigh-dump.c b/examples/rtnl/rtnl-neigh-dump.c
index fc0f205..52fa1c7 100644
--- a/examples/rtnl/rtnl-neigh-dump.c
+++ b/examples/rtnl/rtnl-neigh-dump.c
@@ -17,7 +17,7 @@  static int data_attr_cb(const struct nlattr *attr, void *data)
 	int type = mnl_attr_get_type(attr);
 
 	/* skip unsupported attribute in user-space */
-	if (mnl_attr_type_valid(attr, IFA_MAX) < 0)
+	if (mnl_attr_type_valid(attr, NDA_MAX) < 0)
 		return MNL_CB_OK;
 
 	switch(type) {
@@ -40,7 +40,7 @@  static int data_attr_cb(const struct nlattr *attr, void *data)
 
 static int data_cb(const struct nlmsghdr *nlh, void *data)
 {
-	struct nlattr *tb[IFA_MAX + 1] = {};
+	struct nlattr *tb[NDA_MAX + 1] = {};
 	struct ndmsg *ndm = mnl_nlmsg_get_payload(nlh);
 
 	printf("index=%d family=%d ", ndm->ndm_ifindex, ndm->ndm_family);