summaryrefslogtreecommitdiff
path: root/src/network/networkd-tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-tunnel.c')
-rw-r--r--src/network/networkd-tunnel.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/network/networkd-tunnel.c b/src/network/networkd-tunnel.c
index cffa5644ca..bd12259420 100644
--- a/src/network/networkd-tunnel.c
+++ b/src/network/networkd-tunnel.c
@@ -43,6 +43,8 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
netdev = link->network->tunnel;
+ assert(netdev->family == AF_INET);
+
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
@@ -96,7 +98,7 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_LOCAL, &netdev->local);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_LOCAL, &netdev->local.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_LOCAL attribute: %s",
@@ -104,7 +106,7 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_REMOTE, &netdev->remote);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_REMOTE, &netdev->remote.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_REMOTE attribute: %s",
@@ -150,6 +152,8 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
netdev = link->network->tunnel;
+ assert(netdev->family == AF_INET);
+
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
@@ -203,7 +207,7 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_LOCAL, &netdev->local);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_LOCAL, &netdev->local.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_LOCAL attribute: %s",
@@ -211,7 +215,7 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_REMOTE, &netdev->remote);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_IPTUN_REMOTE, &netdev->remote.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_REMOTE attribute: %s",
@@ -265,6 +269,8 @@ static int netdev_fill_ipgre_rtnl_message(Link *link, sd_rtnl_message *m) {
netdev = link->network->tunnel;
+ assert(netdev->family == AF_INET);
+
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
@@ -318,7 +324,7 @@ static int netdev_fill_ipgre_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_GRE_LOCAL, &netdev->local);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_GRE_LOCAL, &netdev->local.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_GRE_LOCAL attribute: %s",
@@ -326,7 +332,7 @@ static int netdev_fill_ipgre_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_GRE_REMOTE, &netdev->remote);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_GRE_REMOTE, &netdev->remote.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_GRE_REMOTE attribute: %s",
@@ -380,6 +386,8 @@ static int netdev_fill_vti_rtnl_message(Link *link, sd_rtnl_message *m) {
netdev = link->network->tunnel;
+ assert(netdev->family == AF_INET);
+
r = sd_rtnl_message_append_string(m, IFLA_IFNAME, netdev->ifname);
if (r < 0) {
log_error_netdev(netdev,
@@ -433,7 +441,7 @@ static int netdev_fill_vti_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_VTI_LOCAL, &netdev->local);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_VTI_LOCAL, &netdev->local.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_LOCAL attribute: %s",
@@ -441,7 +449,7 @@ static int netdev_fill_vti_rtnl_message(Link *link, sd_rtnl_message *m) {
return r;
}
- r = sd_rtnl_message_append_in_addr(m, IFLA_VTI_REMOTE, &netdev->remote);
+ r = sd_rtnl_message_append_in_addr(m, IFLA_VTI_REMOTE, &netdev->remote.in);
if (r < 0) {
log_error_netdev(netdev,
"Could not append IFLA_IPTUN_REMOTE attribute: %s",