1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

network/veth: refuse when peer and the main interface names are equivalent

This commit is contained in:
Yu Watanabe 2024-09-10 03:00:09 +09:00
parent c60cd572bd
commit 98fbb3b5b0

View File

@ -62,6 +62,10 @@ static int netdev_veth_verify(NetDev *netdev, const char *filename) {
"Veth NetDev without peer name configured in %s. Ignoring",
filename);
if (streq(v->ifname_peer, netdev->ifname))
return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
"Veth peer name cannot be the same as the main interface name.");
return 0;
}