1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

networkd: fix assertion crash for tunnel, log error instead (#5465)

GRE6 and IP6TNL address should be a IPv6.

fix :

```
Assertion 't->family == AF_INET6' failed at src/network/netdev/tunnel.c:170,
function netdev_ip6gre_fill_message_create(). Aborting.
```
This commit is contained in:
Susant Sahani 2017-02-28 15:02:22 +05:30 committed by Martin Pitt
parent 87989f0ea2
commit 8999954f44

View File

@ -410,10 +410,10 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) {
return -EINVAL;
}
if (netdev->kind == NETDEV_KIND_VTI6 &&
if (IN_SET(netdev->kind, NETDEV_KIND_VTI6, NETDEV_KIND_IP6TNL, NETDEV_KIND_IP6GRE) &&
(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);
"vti6/ip6tnl/ip6gre tunnel without a local IPv6 address configured in %s. Ignoring", filename);
return -EINVAL;
}