network: append INTERFACE= attributes for logs corresponds to a netif
This commit is contained in:
@@ -25,7 +25,7 @@ static int netdev_veth_fill_message_create(NetDev *netdev, Link *link, sd_netlin
|
||||
if (v->ifname_peer) {
|
||||
r = sd_netlink_message_append_string(m, IFLA_IFNAME, v->ifname_peer);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to add netlink interface name: %m");
|
||||
return log_netdev_error_errno(netdev, r, "Failed to add netlink interface name: %m");
|
||||
}
|
||||
|
||||
if (v->mac_peer) {
|
||||
@@ -53,16 +53,17 @@ static int netdev_veth_verify(NetDev *netdev, const char *filename) {
|
||||
assert(v);
|
||||
|
||||
if (!v->ifname_peer) {
|
||||
log_warning("Veth NetDev without peer name configured in %s. Ignoring",
|
||||
filename);
|
||||
log_netdev_warning(netdev, "Veth NetDev without peer name configured in %s. Ignoring",
|
||||
filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!v->mac_peer) {
|
||||
r = netdev_get_mac(v->ifname_peer, &v->mac_peer);
|
||||
if (r < 0) {
|
||||
log_warning("Failed to generate predictable MAC address for %s. Ignoring",
|
||||
v->ifname_peer);
|
||||
log_netdev_warning(netdev,
|
||||
"Failed to generate predictable MAC address for %s. Ignoring",
|
||||
v->ifname_peer);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ static int netdev_vlan_verify(NetDev *netdev, const char *filename) {
|
||||
assert(v);
|
||||
|
||||
if (v->id == VLANID_INVALID) {
|
||||
log_warning("VLAN without valid Id (%"PRIu16") configured in %s.", v->id, filename);
|
||||
log_netdev_warning(netdev, "VLAN without valid Id (%"PRIu16") configured in %s.", v->id, filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ static int netdev_vxcan_fill_message_create(NetDev *netdev, Link *link, sd_netli
|
||||
if (v->ifname_peer) {
|
||||
r = sd_netlink_message_append_string(m, IFLA_IFNAME, v->ifname_peer);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to add vxcan netlink interface peer name: %m");
|
||||
return log_netdev_error_errno(netdev, r, "Failed to add vxcan netlink interface peer name: %m");
|
||||
}
|
||||
|
||||
r = sd_netlink_message_close_container(m);
|
||||
@@ -44,7 +44,7 @@ static int netdev_vxcan_verify(NetDev *netdev, const char *filename) {
|
||||
assert(v);
|
||||
|
||||
if (!v->ifname_peer) {
|
||||
log_warning("VxCan NetDev without peer name configured in %s. Ignoring", filename);
|
||||
log_netdev_warning(netdev, "VxCan NetDev without peer name configured in %s. Ignoring", filename);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user