diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 1999-09-22 13:22:26 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 1999-09-22 13:22:26 +0000 |
commit | bd3ed4542de039f6e64818a9b907ec9c23036c3a (patch) | |
tree | 68b06da4166f6877556bb1429749a32b0ff9ec67 /lib | |
parent | bd8beb9b80ebb0480e0ad92bb6ce49c490942c18 (diff) | |
download | src-bd3ed4542de039f6e64818a9b907ec9c23036c3a.tar.gz src-bd3ed4542de039f6e64818a9b907ec9c23036c3a.zip |
ReLink() partial links in FindLinkOut() in the same manner as we do it
in FindLinkIn(). This will make TcpMonitorIn()/TcpMonitorOut() happy.
Reviewed by: eivind
Notes
Notes:
svn path=/head/; revision=51550
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalias/alias_db.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c index 4ac9f43a6b1e..e52656a66e48 100644 --- a/lib/libalias/alias_db.c +++ b/lib/libalias/alias_db.c @@ -510,7 +510,7 @@ ReLink(struct alias_link *, u_short, u_short, int, int); static struct alias_link * -FindLinkOut(struct in_addr, struct in_addr, u_short, u_short, int); +FindLinkOut(struct in_addr, struct in_addr, u_short, u_short, int, int); static struct alias_link * FindLinkIn(struct in_addr, struct in_addr, u_short, u_short, int, int); @@ -1034,7 +1034,8 @@ FindLinkOut(struct in_addr src_addr, struct in_addr dst_addr, u_short src_port, u_short dst_port, - int link_type) + int link_type, + int replace_partial_links) { u_int i; struct alias_link *link; @@ -1063,11 +1064,18 @@ FindLinkOut(struct in_addr src_addr, { if (dst_port != 0) { - link = FindLinkOut(src_addr, dst_addr, src_port, 0, link_type); + link = FindLinkOut(src_addr, dst_addr, src_port, 0, link_type, 0); + if (link != NULL && replace_partial_links) + { + link = ReLink(link, + src_addr, dst_addr, link->alias_addr, + src_port, dst_port, link->alias_port, + link_type); + } } else if (dst_addr.s_addr != 0) { - link = FindLinkOut(src_addr, nullAddress, src_port, 0, link_type); + link = FindLinkOut(src_addr, nullAddress, src_port, 0, link_type, 0); } } @@ -1247,7 +1255,7 @@ FindIcmpOut(struct in_addr src_addr, link = FindLinkOut(src_addr, dst_addr, id, NO_DEST_PORT, - LINK_ICMP); + LINK_ICMP, 0); if (link == NULL) { struct in_addr alias_addr; @@ -1381,7 +1389,7 @@ FindUdpTcpOut(struct in_addr src_addr, break; } - link = FindLinkOut(src_addr, dst_addr, src_port, dst_port, link_type); + link = FindLinkOut(src_addr, dst_addr, src_port, dst_port, link_type, 1); if (link == NULL) { @@ -1428,7 +1436,7 @@ FindAliasAddress(struct in_addr original_addr) struct alias_link *link; link = FindLinkOut(original_addr, nullAddress, - 0, 0, LINK_ADDR); + 0, 0, LINK_ADDR, 0); if (link == NULL) { return aliasAddress; |