diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-25 14:35:40 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-25 14:35:40 +0100 |
commit | 1e23792147b675cf6d3d7e85d02ba3d4dcc886c1 (patch) | |
tree | ce05af47b9489f6516c8ad7baa079d73d11575e6 /src/network/networkd-netdev-veth.c | |
parent | 7c8871d31510865e40c8628ef765996202a3cc00 (diff) | |
parent | c2353b2f2f03b131d99491f458f439e4c65825c9 (diff) |
Merge pull request #1668 from ssahani/net1
networkd: fix asserts
Diffstat (limited to 'src/network/networkd-netdev-veth.c')
-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); |