My application should get netlink multicast route updates from kernel. I did some research and found mutlicast uses different family:RTNL_FAMILY_IPMR and group is RTMGRP_IPV4_MROUTE.
However if I use:
sfd = socket (AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
snl.nl_groups |= RTMGRP_IPV4_MROUTE
I dont get any updates.
But
sfd = socket (AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
snl.nl_family = RTNL_FAMILY_IPMR;
snl.nl_groups |= RTMGRP_IPV4_MROUTE;
This give bind error", bind: Invalid argument
sfd = socket (RTNL_FAMILY_IPMR, SOCK_RAW, NETLINK_ROUTE);
This give "Address family not supported by protocol" error
I'm not sure how to get updates from kernel for mutlicast routes.