| 1268 | } |
| 1269 | |
| 1270 | static struct alias_link * |
| 1271 | FindLinkIn(struct libalias *la, struct in_addr dst_addr, |
| 1272 | struct in_addr alias_addr, |
| 1273 | u_short dst_port, |
| 1274 | u_short alias_port, |
| 1275 | int link_type, |
| 1276 | int replace_partial_links) |
| 1277 | { |
| 1278 | struct alias_link *lnk; |
| 1279 | |
| 1280 | LIBALIAS_LOCK_ASSERT(la); |
| 1281 | lnk = _FindLinkIn(la, dst_addr, alias_addr, dst_port, alias_port, |
| 1282 | link_type, replace_partial_links); |
| 1283 | |
| 1284 | if (lnk == NULL) { |
| 1285 | /* |
| 1286 | * The following allows permanent links to be specified as |
| 1287 | * using the default aliasing address (i.e. device |
| 1288 | * interface address) without knowing in advance what that |
| 1289 | * address is. |
| 1290 | */ |
| 1291 | if (la->aliasAddress.s_addr != INADDR_ANY && |
| 1292 | alias_addr.s_addr == la->aliasAddress.s_addr) { |
| 1293 | lnk = _FindLinkIn(la, dst_addr, la->nullAddress, dst_port, alias_port, |
| 1294 | link_type, replace_partial_links); |
| 1295 | } |
| 1296 | } |
| 1297 | return (lnk); |
| 1298 | } |
| 1299 | |
| 1300 | /* External routines for finding/adding links |
| 1301 |
no test coverage detected