aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/conf.c b/conf.c
index d3d58a7..404c7bc 100644
--- a/conf.c
+++ b/conf.c
@@ -665,8 +665,7 @@ static unsigned int conf_ip4(unsigned int ifi,
if (MAC_IS_ZERO(mac))
nl_link(0, ifi, mac, 0, 0);
- if (IN4_IS_ADDR_UNSPECIFIED(&ip4->gw) ||
- IN4_IS_ADDR_UNSPECIFIED(&ip4->addr) ||
+ if (IN4_IS_ADDR_UNSPECIFIED(&ip4->addr) ||
MAC_IS_ZERO(mac))
return 0;
@@ -708,7 +707,6 @@ static unsigned int conf_ip6(unsigned int ifi,
nl_link(0, ifi, mac, 0, 0);
if (IN6_IS_ADDR_UNSPECIFIED(&ip6->gw) ||
- IN6_IS_ADDR_UNSPECIFIED(&ip6->addr) ||
IN6_IS_ADDR_UNSPECIFIED(&ip6->addr_ll) ||
MAC_IS_ZERO(mac))
return 0;
@@ -1660,6 +1658,12 @@ void conf(struct ctx *c, int argc, char **argv)
(*c->ip6.ifname_out && !c->ifi6))
die("External interface not usable");
+ if (c->ifi4 && IN4_IS_ADDR_UNSPECIFIED(&c->ip4.gw))
+ c->no_map_gw = c->no_dhcp = 1;
+
+ if (c->ifi6 && IN6_IS_ADDR_UNSPECIFIED(&c->ip6.gw))
+ c->no_map_gw = 1;
+
/* Inbound port options can be parsed now (after IPv4/IPv6 settings) */
optind = 1;
do {