projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c60cd57
)
network/veth: refuse when peer and the main interface names are equivalent
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 9 Sep 2024 18:00:09 +0000
(
03:00
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Tue, 10 Sep 2024 10:30:17 +0000
(19:30 +0900)
src/network/netdev/veth.c
patch
|
blob
|
history
diff --git
a/src/network/netdev/veth.c
b/src/network/netdev/veth.c
index 78555286d1a4cc86a4765e8908b5ef8c080caeb6..c9831b21b90f4da924309224eecd31f8755da4e5 100644
(file)
--- a/
src/network/netdev/veth.c
+++ b/
src/network/netdev/veth.c
@@
-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;
}