summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-15 15:48:37 +0200
committerTom Gundersen <teg@jklm.no>2014-05-15 18:15:21 +0200
commitaf4e9e2c563047d524b207e0e3d6816385693a16 (patch)
tree091392995240d050ae888c8dcba4c1899b6ed7e9 /src/network
parent7e28adeb63818ee96dac015c0766be461e13fb64 (diff)
networkd: rename NetDev variable for consistency with Link
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c20
-rw-r--r--src/network/networkd-netdev-gperf.gperf2
-rw-r--r--src/network/networkd-netdev.c18
-rw-r--r--src/network/networkd-network.c2
-rw-r--r--src/network/networkd-tunnel.c4
-rw-r--r--src/network/networkd.h8
6 files changed, 27 insertions, 27 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 6ce965b385..930011ab7f 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1476,7 +1476,7 @@ static int link_enter_enslave(Link *link) {
if (link->network->bond) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, link->network->bond->name,
+ link->ifname, link->network->bond->ifname,
NETDEV(link->network->bond),
NULL);
@@ -1484,7 +1484,7 @@ static int link_enter_enslave(Link *link) {
if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not enslave by '%s': %s",
- link->ifname, link->network->bond->name, strerror(-r),
+ link->ifname, link->network->bond->ifname, strerror(-r),
NETDEV(link->network->bond),
NULL);
link_enter_failed(link);
@@ -1498,7 +1498,7 @@ static int link_enter_enslave(Link *link) {
if (link->network->bridge) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, link->network->bridge->name,
+ link->ifname, link->network->bridge->ifname,
NETDEV(link->network->bridge),
NULL);
@@ -1506,7 +1506,7 @@ static int link_enter_enslave(Link *link) {
if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not enslave by '%s': %s",
- link->ifname, link->network->bridge->name, strerror(-r),
+ link->ifname, link->network->bridge->ifname, strerror(-r),
NETDEV(link->network->bridge),
NULL);
link_enter_failed(link);
@@ -1520,7 +1520,7 @@ static int link_enter_enslave(Link *link) {
if (link->network->tunnel) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, link->network->tunnel->name,
+ link->ifname, link->network->tunnel->ifname,
NETDEV(link->network->tunnel),
NULL);
@@ -1528,7 +1528,7 @@ static int link_enter_enslave(Link *link) {
if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not enslave by '%s': %s",
- link->ifname, link->network->tunnel->name, strerror(-r),
+ link->ifname, link->network->tunnel->ifname, strerror(-r),
NETDEV(link->network->tunnel),
NULL);
link_enter_failed(link);
@@ -1542,13 +1542,13 @@ static int link_enter_enslave(Link *link) {
HASHMAP_FOREACH(vlan, link->network->vlans, i) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, vlan->name, NETDEV(vlan), NULL);
+ link->ifname, vlan->ifname, NETDEV(vlan), NULL);
r = netdev_enslave(vlan, link, &enslave_handler);
if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not enslave by '%s': %s",
- link->ifname, vlan->name, strerror(-r),
+ link->ifname, vlan->ifname, strerror(-r),
NETDEV(vlan), NULL);
link_enter_failed(link);
return r;
@@ -1561,13 +1561,13 @@ static int link_enter_enslave(Link *link) {
HASHMAP_FOREACH(macvlan, link->network->macvlans, i) {
log_struct_link(LOG_DEBUG, link,
"MESSAGE=%s: enslaving by '%s'",
- link->ifname, macvlan->name, NETDEV(macvlan), NULL);
+ link->ifname, macvlan->ifname, NETDEV(macvlan), NULL);
r = netdev_enslave(macvlan, link, &enslave_handler);
if (r < 0) {
log_struct_link(LOG_WARNING, link,
"MESSAGE=%s: could not enslave by '%s': %s",
- link->ifname, macvlan->name, strerror(-r),
+ link->ifname, macvlan->ifname, strerror(-r),
NETDEV(macvlan), NULL);
link_enter_failed(link);
return r;
diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf
index 7e6b8853d5..29889cd476 100644
--- a/src/network/networkd-netdev-gperf.gperf
+++ b/src/network/networkd-netdev-gperf.gperf
@@ -20,7 +20,7 @@ Match.Virtualization, config_parse_net_condition, CONDITION_VIRTUALIZ
Match.KernelCommandLine, config_parse_net_condition, CONDITION_KERNEL_COMMAND_LINE, offsetof(NetDev, match_kernel)
Match.Architecture, config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(NetDev, match_arch)
NetDev.Description, config_parse_string, 0, offsetof(NetDev, description)
-NetDev.Name, config_parse_ifname, 0, offsetof(NetDev, name)
+NetDev.Name, config_parse_ifname, 0, offsetof(NetDev, ifname)
NetDev.Kind, config_parse_netdev_kind, 0, offsetof(NetDev, kind)
NetDev.MTUBytes, config_parse_iec_size, 0, offsetof(NetDev, mtu)
VLAN.Id, config_parse_uint64, 0, offsetof(NetDev, vlanid)
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 62e1a3e26d..3bd6c07822 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -81,13 +81,13 @@ static void netdev_free(NetDev *netdev) {
netdev_cancel_callbacks(netdev);
- if (netdev->name)
- hashmap_remove(netdev->manager->netdevs, netdev->name);
+ if (netdev->ifname)
+ hashmap_remove(netdev->manager->netdevs, netdev->ifname);
free(netdev->filename);
free(netdev->description);
- free(netdev->name);
+ free(netdev->ifname);
condition_free_list(netdev->match_host);
condition_free_list(netdev->match_virt);
@@ -195,7 +195,7 @@ static int netdev_enter_ready(NetDev *netdev) {
netdev_enslave_callback *callback;
assert(netdev);
- assert(netdev->name);
+ assert(netdev->ifname);
if (netdev->state != NETDEV_STATE_CREATING)
return 0;
@@ -267,7 +267,7 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
assert(netdev);
assert(!(netdev->kind == NETDEV_KIND_VLAN || netdev->kind == NETDEV_KIND_MACVLAN) ||
(link && callback));
- assert(netdev->name);
+ assert(netdev->ifname);
assert(netdev->manager);
assert(netdev->manager->rtnl);
@@ -289,7 +289,7 @@ static int netdev_create(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
}
}
- r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->name);
+ r = sd_rtnl_message_append_string(req, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IFNAME attribute: %s",
@@ -464,7 +464,7 @@ int netdev_set_ifindex(NetDev *netdev, sd_rtnl_message *message) {
return r;
}
- if (!streq(netdev->name, received_name)) {
+ if (!streq(netdev->ifname, received_name)) {
log_error_netdev(netdev, "Received newlink with wrong IFNAME %s",
received_name);
netdev_enter_failed(netdev);
@@ -555,7 +555,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
return 0;
}
- if (!netdev->name) {
+ if (!netdev->ifname) {
log_warning("NetDev without Name configured in %s. Ignoring", filename);
return 0;
}
@@ -588,7 +588,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
NULL, NULL, NULL, NULL, NULL, NULL) <= 0)
return 0;
- r = hashmap_put(netdev->manager->netdevs, netdev->name, netdev);
+ r = hashmap_put(netdev->manager->netdevs, netdev->ifname, netdev);
if (r < 0)
return r;
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index d6b06e8a97..91b1e3c7bd 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -315,7 +315,7 @@ int config_parse_netdev(const char *unit,
break;
case NETDEV_KIND_MACVLAN:
- r = hashmap_put(network->macvlans, netdev->name, netdev);
+ r = hashmap_put(network->macvlans, netdev->ifname, netdev);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, EINVAL,
"Can not add MACVLAN to network: %s", rvalue);
diff --git a/src/network/networkd-tunnel.c b/src/network/networkd-tunnel.c
index 0ecb1c971e..5ea28781b3 100644
--- a/src/network/networkd-tunnel.c
+++ b/src/network/networkd-tunnel.c
@@ -43,7 +43,7 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
netdev = link->network->tunnel;
- r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->name);
+ r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IFNAME, attribute: %s",
@@ -141,7 +141,7 @@ int netdev_create_tunnel(Link *link, sd_rtnl_message_handler_t callback) {
netdev = link->network->tunnel;
assert(netdev);
- assert(netdev->name);
+ assert(netdev->ifname);
assert(netdev->manager);
assert(netdev->manager->rtnl);
assert(netdev->manager->kmod_ctx);
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 11d0056c9c..c5f2d076d0 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -97,7 +97,7 @@ struct NetDev {
Condition *match_arch;
char *description;
- char *name;
+ char *ifname;
size_t mtu;
NetDevKind kind;
@@ -435,16 +435,16 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
/* More macros which append INTERFACE= to the message */
-#define log_full_netdev(level, netdev, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->name, "%s: " fmt, netdev->name, ##__VA_ARGS__)
+#define log_full_netdev(level, netdev, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->ifname, "%s: " fmt, netdev->ifname, ##__VA_ARGS__)
#define log_debug_netdev(netdev, ...) log_full_netdev(LOG_DEBUG, netdev, ##__VA_ARGS__)
#define log_info_netdev(netdev, ...) log_full_netdev(LOG_INFO, netdev, ##__VA_ARGS__)
#define log_notice_netdev(netdev, ...) log_full_netdev(LOG_NOTICE, netdev, ##__VA_ARGS__)
#define log_warning_netdev(netdev, ...) log_full_netdev(LOG_WARNING, netdev,## __VA_ARGS__)
#define log_error_netdev(netdev, ...) log_full_netdev(LOG_ERR, netdev, ##__VA_ARGS__)
-#define log_struct_netdev(level, netdev, ...) log_struct(level, "INTERFACE=%s", netdev->name, __VA_ARGS__)
+#define log_struct_netdev(level, netdev, ...) log_struct(level, "INTERFACE=%s", netdev->ifname, __VA_ARGS__)
-#define NETDEV(netdev) "INTERFACE=%s", netdev->name
+#define NETDEV(netdev) "INTERFACE=%s", netdev->ifname
#define ADDRESS_FMT_VAL(address) \
(address).s_addr & 0xFF, \
((address).s_addr >> 8) & 0xFF, \