summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-07-07 22:07:39 +0530
committerTom Gundersen <teg@jklm.no>2014-07-07 21:49:14 +0200
commit948a6f8eb42c85d2b96e9b5817fcfa29ad4752ae (patch)
tree63e3acad4f1b961449ff5abe36bc36e60fc3e762
parentde7a2c8f39bd9f04184fe3fa15d4c9954b5829c9 (diff)
networkd veth: Make kind assert
It's more appropriate to make it's assert than -ENOTSUP
-rw-r--r--src/network/networkd-veth.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/networkd-veth.c b/src/network/networkd-veth.c
index 3eac90ba90..50a5b676b1 100644
--- a/src/network/networkd-veth.c
+++ b/src/network/networkd-veth.c
@@ -122,6 +122,7 @@ int netdev_create_veth(NetDev *netdev, sd_rtnl_message_handler_t callback) {
assert(netdev->ifname);
assert(netdev->manager);
assert(netdev->manager->rtnl);
+ assert(netdev->kind == NETDEV_KIND_VETH);
r = sd_rtnl_message_new_link(netdev->manager->rtnl, &m, RTM_NEWLINK, 0);
if (r < 0) {
@@ -131,9 +132,6 @@ int netdev_create_veth(NetDev *netdev, sd_rtnl_message_handler_t callback) {
return r;
}
- if(netdev->kind != NETDEV_KIND_VETH)
- return -ENOTSUP;
-
r = netdev_fill_veth_rtnl_message(netdev, m);
if(r < 0)
return r;