| 1125 | } |
| 1126 | |
| 1127 | static struct alias_link * |
| 1128 | FindLinkOut(struct libalias *la, struct in_addr src_addr, |
| 1129 | struct in_addr dst_addr, |
| 1130 | u_short src_port, |
| 1131 | u_short dst_port, |
| 1132 | int link_type, |
| 1133 | int replace_partial_links) |
| 1134 | { |
| 1135 | struct alias_link *lnk; |
| 1136 | |
| 1137 | LIBALIAS_LOCK_ASSERT(la); |
| 1138 | lnk = _FindLinkOut(la, src_addr, dst_addr, src_port, dst_port, |
| 1139 | link_type, replace_partial_links); |
| 1140 | |
| 1141 | if (lnk == NULL) { |
| 1142 | /* |
| 1143 | * The following allows permanent links to be specified as |
| 1144 | * using the default source address (i.e. device interface |
| 1145 | * address) without knowing in advance what that address |
| 1146 | * is. |
| 1147 | */ |
| 1148 | if (la->aliasAddress.s_addr != INADDR_ANY && |
| 1149 | src_addr.s_addr == la->aliasAddress.s_addr) { |
| 1150 | lnk = _FindLinkOut(la, la->nullAddress, dst_addr, src_port, dst_port, |
| 1151 | link_type, replace_partial_links); |
| 1152 | } |
| 1153 | } |
| 1154 | return (lnk); |
| 1155 | } |
| 1156 | |
| 1157 | static struct alias_link * |
| 1158 | _FindLinkIn(struct libalias *la, struct in_addr dst_addr, |
no test coverage detected