If kernel does not support the IP multicast address family,
then it will report all routes (PF_UNSPEC).
Give the user a better error message and abort the command.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
fprintf(stderr, "BUG: wrong nlmsg len %d\n", len);
return -1;
}
+
if (r->rtm_type != RTN_MULTICAST) {
- fprintf(stderr, "Not a multicast route (type: %s)\n",
- rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1)));
- return 0;
+ fprintf(stderr,
+ "Non multicast route received, kernel does support IP multicast?\n");
+ return -1;
}
parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);