+/*
+ * netifd - network interface daemon
+ * Copyright (C) 2012 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
#define _GNU_SOURCE
#include <sys/socket.h>
static int system_rtnl_call(struct nl_msg *msg)
{
- int s = -(nl_send_auto_complete(sock_rtnl, msg)
- || nl_wait_for_ack(sock_rtnl));
+ int ret;
+
+ ret = nl_send_auto_complete(sock_rtnl, msg);
nlmsg_free(msg);
- return s;
+
+ if (ret < 0)
+ return ret;
+
+ return nl_wait_for_ack(sock_rtnl);
}
int system_bridge_delbr(struct device *bridge)
if (have_gw)
nla_put(msg, RTA_GATEWAY, alen, &route->nexthop);
- if (route->flags & DEVADDR_DEVICE)
- nla_put_u32(msg, RTA_OIF, ifindex);
+ nla_put_u32(msg, RTA_OIF, ifindex);
return system_rtnl_call(msg);
}