From: Donald Sharp Date: Fri, 17 Jun 2016 13:19:38 +0000 (-0400) Subject: pimd: Use the ifindex to create vif device X-Git-Tag: frr-2.0-rc1~529 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3479bad6390d52bbf2ec07d5d80d2cde1495220c;p=matthieu%2Ffrr.git pimd: Use the ifindex to create vif device It is possible to create multiple interfaces with the same ip address. Looking up the dev to use based upon the ip address will eventually fail when you keep getting the same dev device. Future-Work: I'll need to add a translation to vif index to actual device to use because ifindex's are not guaranteed to be under 256. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 00051719ac..cdce64ca5a 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -462,10 +462,10 @@ int pim_mroute_add_vif(int vif_index, struct in_addr ifaddr, unsigned char flags memset(&vc, 0, sizeof(vc)); vc.vifc_vifi = vif_index; + vc.vifc_lcl_ifindex = vif_index; vc.vifc_flags = flags; vc.vifc_threshold = PIM_MROUTE_MIN_TTL; vc.vifc_rate_limit = 0; - memcpy(&vc.vifc_lcl_addr, &ifaddr, sizeof(vc.vifc_lcl_addr)); #ifdef PIM_DVMRP_TUNNEL if (vc.vifc_flags & VIFF_TUNNEL) {