mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 10:43:35 +08:00
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.
This commit is contained in:
parent
6e47dbbcb3
commit
6f3d4decf2
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user