提交 f6bf7222 编写于 作者: D Dmitry Kozlov

ipoe: more verbose netlink errors

上级 65f2298f
......@@ -58,7 +58,7 @@ int ipoe_nl_add_exclude(uint32_t addr, int mask)
addattr32(nlh, 1024, IPOE_ATTR_ADDR, addr);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
log_ppp_error("ipoe: nl_add_net: error talking to kernel\n");
log_ppp_error("ipoe: nl_add_exclude: %s\n", strerror(errno));
ret = -1;
}
......@@ -93,7 +93,7 @@ void ipoe_nl_del_exclude(uint32_t addr)
addattr32(nlh, 1024, IPOE_ATTR_ADDR, addr);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_ppp_error("ipoe: nl_add_net: error talking to kernel\n");
log_ppp_error("ipoe: nl_del_exclude: %s\n", strerror(errno));
rtnl_close(&rth);
}
......@@ -128,7 +128,7 @@ int ipoe_nl_add_net(uint32_t addr, int mask)
addattr32(nlh, 1024, IPOE_ATTR_MASK, mask);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
log_ppp_error("ipoe: nl_add_net: error talking to kernel\n");
log_ppp_error("ipoe: nl_add_net: %s\n", strerror(errno));
ret = -1;
}
......@@ -163,7 +163,7 @@ void ipoe_nl_del_net(uint32_t addr)
addattr32(nlh, 1024, IPOE_ATTR_ADDR, addr);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_ppp_error("ipoe: nl_del_net: error talking to kernel\n");
log_ppp_error("ipoe: nl_del_net: %s\n", strerror(errno));
rtnl_close(&rth);
}
......@@ -195,7 +195,7 @@ void ipoe_nl_add_interface(int ifindex, uint8_t mode)
addattr_l(nlh, 1024, IPOE_ATTR_MODE, &mode, 1);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_error("ipoe: nl_add_iface: error talking to kernel\n");
log_error("ipoe: nl_add_iface: %s\n", strerror(errno));
rtnl_close(&rth);
}
......@@ -226,7 +226,7 @@ void ipoe_nl_del_interface(int ifindex)
addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_error("ipoe: nl_del_iface: error talking to kernel\n");
log_error("ipoe: nl_del_iface: %s\n", strerror(errno));
rtnl_close(&rth);
}
......@@ -265,8 +265,10 @@ int ipoe_nl_create(int ifindex)
addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_ppp_error("ipoe: nl_create: error talking to kernel\n");
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
log_ppp_error("ipoe: nl_create: %s\n", strerror(errno));
goto out;
}
if (nlh->nlmsg_type != ipoe_genl_id) {
log_ppp_error("ipoe: not a IPoE message %d\n", nlh->nlmsg_type);
......@@ -337,7 +339,7 @@ int ipoe_nl_modify(int ifindex, uint32_t peer_addr, uint32_t addr, uint32_t gw,
addattr_l(nlh, 1024, IPOE_ATTR_HWADDR, hwaddr, 6);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
log_ppp_error("ipoe: nl_create: error talking to kernel\n");
log_ppp_error("ipoe: nl_modify: %s\n", strerror(errno));
ret = -1;
}
......@@ -451,7 +453,7 @@ void ipoe_nl_delete(int ifindex)
addattr32(nlh, 128, IPOE_ATTR_IFINDEX, ifindex);
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 )
log_ppp_error("ipoe: nl_delete: error talking to kernel\n");
log_ppp_error("ipoe: nl_delete: %s\n", strerror(errno));
rtnl_close(&rth);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册