From 0695cb45727f88308e327471089ccca42d2a0fb1 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Sun, 25 Oct 2015 09:24:59 +0530 Subject: ipvlan: fix assert --- src/network/networkd-netdev-ipvlan.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/network/networkd-netdev-ipvlan.c b/src/network/networkd-netdev-ipvlan.c index 5eb4a1eb36..fb0aed0dcb 100644 --- a/src/network/networkd-netdev-ipvlan.c +++ b/src/network/networkd-netdev-ipvlan.c @@ -33,14 +33,17 @@ DEFINE_STRING_TABLE_LOOKUP(ipvlan_mode, IPVlanMode); DEFINE_CONFIG_PARSE_ENUM(config_parse_ipvlan_mode, ipvlan_mode, IPVlanMode, "Failed to parse ipvlan mode"); static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *req) { - IPVlan *m = IPVLAN(netdev); + IPVlan *m; int r; assert(netdev); - assert(m); assert(link); assert(netdev->ifname); + m = IPVLAN(netdev); + + assert(m); + if (m->mode != _NETDEV_IPVLAN_MODE_INVALID) { r = sd_netlink_message_append_u16(req, IFLA_IPVLAN_MODE, m->mode); if (r < 0) @@ -51,9 +54,12 @@ static int netdev_ipvlan_fill_message_create(NetDev *netdev, Link *link, sd_netl } static void ipvlan_init(NetDev *n) { - IPVlan *m = IPVLAN(n); + IPVlan *m; assert(n); + + m = IPVLAN(n); + assert(m); m->mode = _NETDEV_IPVLAN_MODE_INVALID; -- cgit v1.2.3-54-g00ecf