summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev-bond.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2015-10-25 09:24:31 +0530
committerSusant Sahani <ssahani@gmail.com>2015-10-25 09:30:59 +0530
commitae185f485728ab9b033f4b60a7c85ecb33436ff7 (patch)
tree5fdcb218aaf82dbf18a41657a101c5189291b8ed /src/network/networkd-netdev-bond.c
parent2645f07d81e72acd65f32d582702dc4cbe54cac7 (diff)
bond: fix assert
Diffstat (limited to 'src/network/networkd-netdev-bond.c')
-rw-r--r--src/network/networkd-netdev-bond.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/network/networkd-netdev-bond.c b/src/network/networkd-netdev-bond.c
index bcaba57937..b8d94b9381 100644
--- a/src/network/networkd-netdev-bond.c
+++ b/src/network/networkd-netdev-bond.c
@@ -178,15 +178,18 @@ static uint8_t bond_xmit_hash_policy_to_kernel(BondXmitHashPolicy policy) {
}
static int netdev_bond_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
- Bond *b = BOND(netdev);
+ Bond *b;
ArpIpTarget *target = NULL;
int r, i = 0;
assert(netdev);
assert(!link);
- assert(b);
assert(m);
+ b = BOND(netdev);
+
+ assert(b);
+
if (b->mode != _NETDEV_BOND_MODE_INVALID) {
r = sd_netlink_message_append_u8(m, IFLA_BOND_MODE,
bond_mode_to_kernel(b->mode));
@@ -380,9 +383,12 @@ int config_parse_arp_ip_target_address(const char *unit,
static void bond_done(NetDev *netdev) {
ArpIpTarget *t = NULL, *n = NULL;
- Bond *b = BOND(netdev);
+ Bond *b;
assert(netdev);
+
+ b = BOND(netdev);
+
assert(b);
LIST_FOREACH_SAFE(arp_ip_target, t, n, b->arp_ip_targets)
@@ -392,9 +398,12 @@ static void bond_done(NetDev *netdev) {
}
static void bond_init(NetDev *netdev) {
- Bond *b = BOND(netdev);
+ Bond *b;
assert(netdev);
+
+ b = BOND(netdev);
+
assert(b);
b->mode = _NETDEV_BOND_MODE_INVALID;