mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-13 19:27:38 +00:00
mroute: fix up family handling
Only ipv4 and ipv6 have multicast routing. Set family accordingly and just return for other cases. Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
c7e6371bc4
commit
98ce99273f
@ -223,18 +223,20 @@ void ipmroute_reset_filter(int ifindex)
|
|||||||
static int mroute_list(int argc, char **argv)
|
static int mroute_list(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *id = NULL;
|
char *id = NULL;
|
||||||
int family;
|
int family = preferred_family;
|
||||||
|
|
||||||
ipmroute_reset_filter(0);
|
ipmroute_reset_filter(0);
|
||||||
if (preferred_family == AF_UNSPEC)
|
if (family == AF_INET || family == AF_UNSPEC) {
|
||||||
family = AF_INET;
|
family = RTNL_FAMILY_IPMR;
|
||||||
else
|
|
||||||
family = AF_INET6;
|
|
||||||
if (family == AF_INET) {
|
|
||||||
filter.af = RTNL_FAMILY_IPMR;
|
filter.af = RTNL_FAMILY_IPMR;
|
||||||
filter.tb = RT_TABLE_DEFAULT; /* for backward compatibility */
|
filter.tb = RT_TABLE_DEFAULT; /* for backward compatibility */
|
||||||
} else
|
} else if (family == AF_INET6) {
|
||||||
|
family = RTNL_FAMILY_IP6MR;
|
||||||
filter.af = RTNL_FAMILY_IP6MR;
|
filter.af = RTNL_FAMILY_IP6MR;
|
||||||
|
} else {
|
||||||
|
/* family does not have multicast routing */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
filter.msrc.family = filter.mdst.family = family;
|
filter.msrc.family = filter.mdst.family = family;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user