* Checks if @ia needs to install loopback route to @ia address via * ifa_maintain_loopback_route(). * * Return true on success. */
| 801 | * Return true on success. |
| 802 | */ |
| 803 | static bool |
| 804 | ia_need_loopback_route(const struct in_ifaddr *ia) |
| 805 | { |
| 806 | struct ifnet *ifp = ia->ia_ifp; |
| 807 | |
| 808 | /* Case 4: Skip loopback interfaces */ |
| 809 | if ((ifp->if_flags & IFF_LOOPBACK) || |
| 810 | (ia->ia_addr.sin_addr.s_addr == INADDR_ANY)) |
| 811 | return (false); |
| 812 | |
| 813 | /* Clash avoidance: Skip p2p interfaces with both addresses are equal */ |
| 814 | if ((ifp->if_flags & IFF_POINTOPOINT) && |
| 815 | ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) |
| 816 | return (false); |
| 817 | |
| 818 | /* Case 2: skip /32 prefixes */ |
| 819 | if (!(ifp->if_flags & IFF_POINTOPOINT) && |
| 820 | (ia->ia_sockmask.sin_addr.s_addr == INADDR_BROADCAST)) |
| 821 | return (false); |
| 822 | |
| 823 | return (true); |
| 824 | } |
| 825 | |
| 826 | /* |
| 827 | * Calculate "prefix" route corresponding to @ia. |
no outgoing calls
no test coverage detected