summaryrefslogtreecommitdiffstats
path: root/lib/libalias
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>1999-09-22 13:22:26 +0000
committerru <ru@FreeBSD.org>1999-09-22 13:22:26 +0000
commitfbd7c04554808bd9d40f136443fea46d86c409d2 (patch)
tree8c909a1fb11d833cdd874de0570f34f4d72c3377 /lib/libalias
parentdffae6b422767f994e05fc232c42d6918f39aa10 (diff)
downloadFreeBSD-src-fbd7c04554808bd9d40f136443fea46d86c409d2.zip
FreeBSD-src-fbd7c04554808bd9d40f136443fea46d86c409d2.tar.gz
ReLink() partial links in FindLinkOut() in the same manner as we do it
in FindLinkIn(). This will make TcpMonitorIn()/TcpMonitorOut() happy. Reviewed by: eivind
Diffstat (limited to 'lib/libalias')
-rw-r--r--lib/libalias/alias_db.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c
index 4ac9f43..e52656a 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;
OpenPOWER on IntegriCloud