diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-12-02 13:34:35 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-12-09 13:55:14 -0500 |
commit | 6f3d4decf296f0f0fb2b15dd80216f130f10727d (patch) | |
tree | bc02909172435120e8f529de3653a1474e0c9f41 | |
parent | 6e47dbbcb32ad9b391296ae47e540c3506431c8f (diff) |
networkd: check that VTI/VTI6 tunnels have a local address
Otherwise we'd fail with an assertion:
Assertion 't->family == AF_INET' failed at ../src/network/netdev/tunnel.c:244, function netdev_vti_fill_message_create(). Aborting.
-rw-r--r-- | src/network/netdev/tunnel.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c index 2ce55a84b6..c11ac0c539 100644 --- a/src/network/netdev/tunnel.c +++ b/src/network/netdev/tunnel.c @@ -403,6 +403,20 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { return -EINVAL; } + if (netdev->kind == NETDEV_KIND_VTI && + (t->family != AF_INET || in_addr_is_null(t->family, &t->local))) { + log_netdev_error(netdev, + "vti tunnel without a local IPv4 address configured in %s. Ignoring", filename); + return -EINVAL; + } + + if (netdev->kind == NETDEV_KIND_VTI6 && + (t->family != AF_INET6 || in_addr_is_null(t->family, &t->local))) { + log_netdev_error(netdev, + "vti6 tunnel without a local IPv4 address configured in %s. Ignoring", filename); + return -EINVAL; + } + if (netdev->kind == NETDEV_KIND_IP6TNL && t->ip6tnl_mode == _NETDEV_IP6_TNL_MODE_INVALID) { log_netdev_error(netdev, |