See HISTORY file for additional revisions.
- $OpenBSD: alias_db.c,v 1.7 2000/03/19 10:33:32 brian Exp $
+ $OpenBSD: alias_db.c,v 1.8 2000/04/02 01:36:20 brian Exp $
*/
link->src_addr = src_addr;
link->dst_addr = dst_addr;
link->alias_addr = alias_addr;
- link->proxy_addr.s_addr = 0;
+ link->proxy_addr.s_addr = INADDR_ANY;
link->src_port = src_port;
link->dst_port = dst_port;
link->proxy_port = 0;
}
/* Determine alias flags */
- if (dst_addr.s_addr == 0)
+ if (dst_addr.s_addr == INADDR_ANY)
link->flags |= LINK_UNKNOWN_DEST_ADDR;
if (dst_port == 0)
link->flags |= LINK_UNKNOWN_DEST_PORT;
loop will have to know about this. */
flags_in = 0;
- if (dst_addr.s_addr == 0)
+ if (dst_addr.s_addr == INADDR_ANY)
flags_in |= LINK_UNKNOWN_DEST_ADDR;
if (dst_port == 0)
flags_in |= LINK_UNKNOWN_DEST_PORT;
if (link == NULL)
{
newDefaultLink = 1;
- if (targetAddress.s_addr != 0)
- return targetAddress;
- else
+ if (targetAddress.s_addr == INADDR_ANY)
return alias_addr;
+ else if (targetAddress.s_addr == INADDR_NONE)
+ return aliasAddress;
+ else
+ return targetAddress;
}
else
{
- if (link->src_addr.s_addr == 0)
+ if (link->src_addr.s_addr == INADDR_ANY)
return aliasAddress;
else
return link->src_addr;
}
else
{
- if (link->alias_addr.s_addr == 0)
+ if (link->alias_addr.s_addr == INADDR_ANY)
return aliasAddress;
else
return link->alias_addr;
struct in_addr
GetOriginalAddress(struct alias_link *link)
{
- if (link->src_addr.s_addr == 0)
+ if (link->src_addr.s_addr == INADDR_ANY)
return aliasAddress;
else
return(link->src_addr);
struct in_addr
GetAliasAddress(struct alias_link *link)
{
- if (link->alias_addr.s_addr == 0)
+ if (link->alias_addr.s_addr == INADDR_ANY)
return aliasAddress;
else
return link->alias_addr;
deleteAllLinks = 0;
}
- aliasAddress.s_addr = 0;
- targetAddress.s_addr = 0;
+ aliasAddress.s_addr = INADDR_ANY;
+ targetAddress.s_addr = INADDR_NONE;
icmpLinkCount = 0;
udpLinkCount = 0;
* The code in this file was written by Eivind Eklund <perhaps@yes.no>,
* who places it in the public domain without restriction.
*
- * $OpenBSD: nat_cmd.c,v 1.9 2000/03/31 14:32:51 brian Exp $
+ * $OpenBSD: nat_cmd.c,v 1.10 2000/04/02 01:36:20 brian Exp $
*/
#include <sys/param.h>
struct in_addr addr;
if (arg->argc == arg->argn) {
- addr.s_addr = INADDR_ANY;
+ addr.s_addr = INADDR_NONE;
PacketAliasSetTarget(addr);
return 0;
}