diff options
author | ru <ru@FreeBSD.org> | 2000-08-31 12:47:57 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-08-31 12:47:57 +0000 |
commit | 5feb1713feb5366d159faaad92b078dd47c87625 (patch) | |
tree | 8b7f0af19578b5952d9ee0c470211db4e3a3a198 /lib/libalias/alias_db.c | |
parent | dd66d6917025a4223f25293d5c217e072449ee17 (diff) | |
download | FreeBSD-src-5feb1713feb5366d159faaad92b078dd47c87625.zip FreeBSD-src-5feb1713feb5366d159faaad92b078dd47c87625.tar.gz |
Create aliasing links for incoming ICMP echo/timestamp requests.
This makes outgoing ICMP echo/timestamp replies to be de-aliased
with the right source IP, not exactly the primary aliasing IP.
Diffstat (limited to 'lib/libalias/alias_db.c')
-rw-r--r-- | lib/libalias/alias_db.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libalias/alias_db.c b/lib/libalias/alias_db.c index f304c14..0facbaa 100644 --- a/lib/libalias/alias_db.c +++ b/lib/libalias/alias_db.c @@ -1401,9 +1401,22 @@ FindIcmpIn(struct in_addr dst_addr, struct in_addr alias_addr, u_short id_alias) { - return FindLinkIn(dst_addr, alias_addr, + struct alias_link *link; + + link = FindLinkIn(dst_addr, alias_addr, NO_DEST_PORT, id_alias, LINK_ICMP, 0); + if (link == NULL && !(packetAliasMode & PKT_ALIAS_DENY_INCOMING)) + { + struct in_addr target_addr; + + target_addr = FindOriginalAddress(alias_addr); + link = AddLink(target_addr, dst_addr, alias_addr, + id_alias, NO_DEST_PORT, id_alias, + LINK_ICMP); + } + + return (link); } |