diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ipmr.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 630a56df7b47..c757f0b4b74c 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -469,8 +469,18 @@ static int vif_add(struct net *net, struct vifctl *vifc, int mrtsock) | |||
469 | return err; | 469 | return err; |
470 | } | 470 | } |
471 | break; | 471 | break; |
472 | |||
473 | case VIFF_USE_IFINDEX: | ||
472 | case 0: | 474 | case 0: |
473 | dev = ip_dev_find(net, vifc->vifc_lcl_addr.s_addr); | 475 | if (vifc->vifc_flags == VIFF_USE_IFINDEX) { |
476 | dev = dev_get_by_index(net, vifc->vifc_lcl_ifindex); | ||
477 | if (dev && dev->ip_ptr == NULL) { | ||
478 | dev_put(dev); | ||
479 | return -EADDRNOTAVAIL; | ||
480 | } | ||
481 | } else | ||
482 | dev = ip_dev_find(net, vifc->vifc_lcl_addr.s_addr); | ||
483 | |||
474 | if (!dev) | 484 | if (!dev) |
475 | return -EADDRNOTAVAIL; | 485 | return -EADDRNOTAVAIL; |
476 | err = dev_set_allmulti(dev, 1); | 486 | err = dev_set_allmulti(dev, 1); |