diff options
author | Susant Sahani <ssahani@gmail.com> | 2015-10-25 09:25:16 +0530 |
---|---|---|
committer | Susant Sahani <ssahani@gmail.com> | 2015-10-25 09:31:18 +0530 |
commit | cd946b9c36b77625d361c917a204beb434f41e80 (patch) | |
tree | 2494b52b252135e4e0c46d8806ee6a7d5f42714c /src | |
parent | 0695cb45727f88308e327471089ccca42d2a0fb1 (diff) |
veth: fix assert
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-netdev-veth.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/network/networkd-netdev-veth.c b/src/network/networkd-netdev-veth.c index e20f9f74e2..bee1a16726 100644 --- a/src/network/networkd-netdev-veth.c +++ b/src/network/networkd-netdev-veth.c @@ -26,14 +26,17 @@ #include "networkd-netdev-veth.h" static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) { - Veth *v = VETH(netdev); + Veth *v; int r; assert(netdev); assert(!link); - assert(v); assert(m); + v = VETH(netdev); + + assert(v); + r = sd_netlink_message_open_container(m, VETH_INFO_PEER); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append VETH_INFO_PEER attribute: %m"); @@ -58,13 +61,16 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlin } static int netdev_veth_verify(NetDev *netdev, const char *filename) { - Veth *v = VETH(netdev); + Veth *v; int r; assert(netdev); - assert(v); assert(filename); + v = VETH(netdev); + + assert(v); + if (!v->ifname_peer) { log_warning("Veth NetDev without peer name configured in %s. Ignoring", filename); @@ -84,9 +90,12 @@ static int netdev_veth_verify(NetDev *netdev, const char *filename) { } static void veth_done(NetDev *n) { - Veth *v = VETH(n); + Veth *v; assert(n); + + v = VETH(n); + assert(v); free(v->ifname_peer); |