Revision 153f02da proto/rip/packets.c

View differences:

proto/rip/packets.c
669 669
      sk->iface->name, sk->faddr, sk->laddr);
670 670

  
671 671
  /* Silently ignore my own packets */
672
  /* FIXME: Better local address check */
673
  if (ipa_equal(ifa->iface->addr->ip, sk->faddr))
672
  if (ipa_equal(sk->faddr, sk->saddr))
674 673
    return 1;
675 674

  
676 675
  if (rip_is_ng(p) && !ipa_is_link_local(sk->faddr))
......
742 741
  sk->sport = ifa->cf->port;
743 742
  sk->dport = ifa->cf->port;
744 743
  sk->iface = ifa->iface;
745

  
746
  /*
747
   * For RIPv2, we explicitly choose a primary address, mainly to ensure that
748
   * RIP and BFD uses the same one. For RIPng, we left it to kernel, which
749
   * should choose some link-local address based on the same scope rule.
750
   */
751
  if (rip_is_v2(p))
752
    sk->saddr = ifa->iface->addr->ip;
744
  sk->saddr = rip_is_v2(p) ? ifa->iface->addr4->ip : ifa->iface->llv6->ip;
753 745

  
754 746
  sk->rx_hook = rip_rx_hook;
755 747
  sk->tx_hook = rip_tx_hook;

Also available in: Unified diff