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-ipvlan.c | |
parent | 7c8871d31510865e40c8628ef765996202a3cc00 (diff) | |
parent | c2353b2f2f03b131d99491f458f439e4c65825c9 (diff) |
Merge pull request #1668 from ssahani/net1
networkd: fix asserts
Diffstat (limited to 'src/network/networkd-netdev-ipvlan.c')
-rw-r--r-- | src/network/networkd-netdev-ipvlan.c | 12 |
1 files 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; |