From ec2a3e3af25bc8c4d620a201e11645e70697f8de Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Thu, 23 Jul 2015 09:52:24 +0530 Subject: networkd: ip6 tunnel add DSCP This patch adds support for setting the DSCP field in the ip6 tunnel. when set it inherits DSCP field between inner and outer header. --- src/network/networkd-netdev-gperf.gperf | 1 + src/network/networkd-netdev-tunnel.c | 3 +++ src/network/networkd-netdev-tunnel.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf index 63258c0376..bdc43e87f6 100644 --- a/src/network/networkd-netdev-gperf.gperf +++ b/src/network/networkd-netdev-gperf.gperf @@ -37,6 +37,7 @@ Tunnel.TTL, config_parse_unsigned, 0, Tunnel.DiscoverPathMTU, config_parse_bool, 0, offsetof(Tunnel, pmtudisc) Tunnel.Mode, config_parse_ip6tnl_mode, 0, offsetof(Tunnel, ip6tnl_mode) Tunnel.IPv6FlowLabel, config_parse_ipv6_flowlabel, 0, offsetof(Tunnel, ipv6_flowlabel) +Tunnel.DiffServiceCodePoint, config_parse_bool, 0, offsetof(Tunnel, dscp) Peer.Name, config_parse_ifname, 0, offsetof(Veth, ifname_peer) Peer.MACAddress, config_parse_hwaddr, 0, offsetof(Veth, mac_peer) VXLAN.Id, config_parse_uint64, 0, offsetof(VxLan, id) diff --git a/src/network/networkd-netdev-tunnel.c b/src/network/networkd-netdev-tunnel.c index a13edf6936..ecf0604c4b 100644 --- a/src/network/networkd-netdev-tunnel.c +++ b/src/network/networkd-netdev-tunnel.c @@ -271,6 +271,9 @@ static int netdev_ip6tnl_fill_message_create(NetDev *netdev, Link *link, sd_netl return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_FLOWINFO attribute: %m"); } + if (t->dscp) + t->flags |= IP6_TNL_F_RCV_DSCP_COPY; + r = sd_netlink_message_append_u32(m, IFLA_IPTUN_FLAGS, t->flags); if (r < 0) return log_netdev_error_errno(netdev, r, "Could not append IFLA_IPTUN_FLAGS attribute: %m"); diff --git a/src/network/networkd-netdev-tunnel.h b/src/network/networkd-netdev-tunnel.h index 47981fbe32..e08e2891e7 100644 --- a/src/network/networkd-netdev-tunnel.h +++ b/src/network/networkd-netdev-tunnel.h @@ -57,6 +57,7 @@ struct Tunnel { IPv6FlowLabel ipv6_flowlabel; bool pmtudisc; + bool dscp; }; extern const NetDevVTable ipip_vtable; -- cgit v1.2.3-54-g00ecf From 9b0ca30a91b661f56ed7cee5bab02cc5aef6d38b Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Thu, 23 Jul 2015 13:38:26 +0530 Subject: man: add man for DSCP --- man/systemd.netdev.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml index d15c21be60..b100f96b85 100644 --- a/man/systemd.netdev.xml +++ b/man/systemd.netdev.xml @@ -503,6 +503,17 @@ or can be configured to any value betwen 0 to 0xFFFFF. + + DiffServiceCodePoint= + + A boolean. When true, inherits the Differentiated + Service Code Point (DSCP) field between inner and outer + header for ip6_tunnel. DSCP is a field in an IP packet + that enables different levels of service to be assigned + to network traffic. Defaults to no. + + + Mode= -- cgit v1.2.3-54-g00ecf