summaryrefslogtreecommitdiffstats
path: root/sys/netinet/libalias
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>1999-09-21 08:40:20 +0000
committerru <ru@FreeBSD.org>1999-09-21 08:40:20 +0000
commiteb97f5a4deba0dc534270e6fe9b3c49f35c34f59 (patch)
tree877805a6ae38db4237f0d40408768c3f377252db /sys/netinet/libalias
parent37bee3bb3f0cedaa15e074e03de098469f37fe08 (diff)
downloadFreeBSD-src-eb97f5a4deba0dc534270e6fe9b3c49f35c34f59.zip
FreeBSD-src-eb97f5a4deba0dc534270e6fe9b3c49f35c34f59.tar.gz
- Make partially specified permanent links (without `dst_addr' and/or
`dst_port') work for outgoing packets. - Make permanent links whose `alias_addr' matches the primary aliasing address `aliasAddress' work for incoming packets. - Typo fixes. Reviewed by: brian, eivind
Diffstat (limited to 'sys/netinet/libalias')
-rw-r--r--sys/netinet/libalias/alias_db.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index 85e15d2..89bcc54 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -144,7 +144,7 @@
#define ALIAS_CLEANUP_INTERVAL_SECS 60
#define ALIAS_CLEANUP_MAX_SPOKES 30
-/* Timouts (in seconds) for different link types) */
+/* Timeouts (in seconds) for different link types */
#define ICMP_EXPIRE_TIME 60
#define UDP_EXPIRE_TIME 60
#define FRAGMENT_ID_EXPIRE_TIME 10
@@ -367,9 +367,9 @@ static struct in_addr pptpAliasAddr; /* Address of source of PPTP */
Lookup table starting points:
StartPointIn() -- link table initial search point for
- outgoing packets
- StartPointOut() -- port table initial search point for
incoming packets
+ StartPointOut() -- port table initial search point for
+ outgoing packets
Miscellaneous:
SeqDiff() -- difference between two TCP sequences
@@ -1058,6 +1058,19 @@ FindLinkOut(struct in_addr src_addr,
link = link->next_out;
}
+/* Search for partially specified links. */
+ if (link == NULL)
+ {
+ if (dst_port != 0)
+ {
+ link = FindLinkOut(src_addr, dst_addr, src_port, 0, link_type);
+ }
+ else if (dst_addr.s_addr != 0)
+ {
+ link = FindLinkOut(src_addr, nullAddress, src_port, 0, link_type);
+ }
+ }
+
return(link);
}
@@ -1093,14 +1106,6 @@ FindLinkIn(struct in_addr dst_addr,
if (dst_port == 0)
flags_in |= LINK_UNKNOWN_DEST_PORT;
-/* The following allows permanent links to be
- be specified as using the default aliasing address
- (i.e. device interface address) without knowing
- in advance what that address is. */
-
- if (alias_addr.s_addr == aliasAddress.s_addr)
- alias_addr.s_addr = 0;
-
/* Search loop */
start_point = StartPointIn(alias_addr, alias_port, link_type);
link = linkTableIn[start_point];
@@ -1191,6 +1196,15 @@ FindLinkIn(struct in_addr dst_addr,
link_type)
: link_unknown_all;
}
+/* The following allows permanent links to be
+ be specified as using the default aliasing address
+ (i.e. device interface address) without knowing
+ in advance what that address is. */
+ else if (alias_addr.s_addr != 0 && alias_addr.s_addr == aliasAddress.s_addr)
+ {
+ return FindLinkIn(dst_addr, nullAddress, dst_port, alias_port,
+ link_type, replace_partial_links);
+ }
else
{
return(NULL);
OpenPOWER on IntegriCloud