Merge pull request #11021 from ssahani/isatap

networkd: Add support to configure ISATAP tunnel
This commit is contained in:
Yu Watanabe
2018-12-05 23:13:17 +01:00
committed by GitHub
8 changed files with 47 additions and 2 deletions
+1
View File
@@ -73,6 +73,7 @@ Tunnel.Encapsulation, config_parse_fou_encap_type, 0,
Tunnel.IPv6RapidDeploymentPrefix, config_parse_6rd_prefix, 0, 0
Tunnel.ERSPANIndex, config_parse_uint32, 0, offsetof(Tunnel, erspan_index)
Tunnel.SerializeTunneledPackets, config_parse_tristate, 0, offsetof(Tunnel, erspan_sequence)
Tunnel.ISATAP, config_parse_tristate, 0, offsetof(Tunnel, isatap)
FooOverUDP.Protocol, config_parse_uint8, 0, offsetof(FouTunnel, fou_protocol)
FooOverUDP.Encapsulation, config_parse_fou_encap_type, 0, offsetof(FouTunnel, fou_encap_type)
FooOverUDP.Port, config_parse_ip_port, 0, offsetof(FouTunnel, port)
+12
View File
@@ -118,6 +118,7 @@ static int netdev_sit_fill_message_create(NetDev *netdev, Link *link, sd_netlink
r = sd_netlink_message_append_in6_addr(m, IFLA_IPTUN_6RD_PREFIX, &t->sixrd_prefix);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_6RD_PREFIX attribute: %m");
/* u16 is deliberate here, even though we're passing a netmask that can never be >128. The kernel is
* expecting to receive the prefixlen as a u16.
*/
@@ -126,6 +127,16 @@ static int netdev_sit_fill_message_create(NetDev *netdev, Link *link, sd_netlink
return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_6RD_PREFIXLEN attribute: %m");
}
if (t->isatap >= 0) {
uint16_t flags = 0;
SET_FLAG(flags, SIT_ISATAP, t->isatap);
r = sd_netlink_message_append_u16(m, IFLA_IPTUN_FLAGS, flags);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_FLAGS attribute: %m");
}
return r;
}
@@ -761,6 +772,7 @@ static void sit_init(NetDev *n) {
assert(t);
t->pmtudisc = true;
t->isatap = -1;
}
static void vti_init(NetDev *n) {
+1
View File
@@ -30,6 +30,7 @@ typedef struct Tunnel {
int ipv6_flowlabel;
int allow_localremote;
int erspan_sequence;
int isatap;
unsigned ttl;
unsigned tos;