[systemd-devel] [PATCH 1/1] networkd: sit-tunnel add support for pmtudisc

Lennart Poettering lennart at poettering.net
Tue May 20 05:37:16 PDT 2014


On Tue, 20.05.14 15:08, Susant Sahani (susant at redhat.com) wrote:

> This patch adds path of mtu discovery for sit tunnel.
> To enable/disable DiscoverPathMTU is introduced.
> 
> Example configuration
> 
> file: sit.netdev
> [NetDev]
> Name=sit-tun
> Kind=sit
> MTUBytes=1480
> 
> [Tunnel]
> DiscoverPathMTU=1
> Local=X.X.X.X
> Remote=X.X.X.X
> 
> By default pmtudisc is turned on , if DiscoverPathMTU
> is missing from the config. To turn it off
> DiscoverPathMTU=0 needs to be set.
> ---
>  src/network/networkd-netdev-gperf.gperf |  1 +
>  src/network/networkd-netdev.c           |  1 +
>  src/network/networkd-tunnel.c           | 12 ++++++++++++
>  src/network/networkd.h                  |  1 +
>  4 files changed, 15 insertions(+)
> 
> diff --git a/src/network/networkd-netdev-gperf.gperf b/src/network/networkd-netdev-gperf.gperf
> index 29889cd..b171d76 100644
> --- a/src/network/networkd-netdev-gperf.gperf
> +++ b/src/network/networkd-netdev-gperf.gperf
> @@ -29,3 +29,4 @@ Tunnel.Local,            config_parse_tunnel_address,        0,
>  Tunnel.Remote,           config_parse_tunnel_address,        0,                             offsetof(NetDev, tunnel_remote)
>  Tunnel.TOS,              config_parse_unsigned,              0,                             offsetof(NetDev, tunnel_tos)
>  Tunnel.TTL,              config_parse_unsigned,              0,                             offsetof(NetDev, tunnel_ttl)
> +Tunnel.DiscoverPathMTU,  config_parse_bool,                  0,                             offsetof(NetDev, tunnel_pmtudisc)
> diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
> index c54b0c1..63f8ff7 100644
> --- a/src/network/networkd-netdev.c
> +++ b/src/network/networkd-netdev.c
> @@ -545,6 +545,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
>          netdev->kind = _NETDEV_KIND_INVALID;
>          netdev->macvlan_mode = _NETDEV_MACVLAN_MODE_INVALID;
>          netdev->vlanid = VLANID_MAX + 1;
> +        netdev->tunnel_pmtudisc = 1;

This is a bool, right? If so, this should probably be "true"...

>  
>          r = config_parse(NULL, filename, file, "Match\0NetDev\0VLAN\0MACVLAN\0Tunnel\0",
>                           config_item_perf_lookup, (void*) network_netdev_gperf_lookup,
> diff --git a/src/network/networkd-tunnel.c b/src/network/networkd-tunnel.c
> index fee474c..2cabc42 100644
> --- a/src/network/networkd-tunnel.c
> +++ b/src/network/networkd-tunnel.c
> @@ -131,6 +131,7 @@ static int netdev_fill_ipip_rtnl_message(Link *link, sd_rtnl_message *m) {
>  
>  static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
>          NetDev *netdev;
> +        uint8_t pmtudisc;
>          int r;
>  
>          assert(link);
> @@ -207,6 +208,17 @@ static int netdev_fill_sit_rtnl_message(Link *link, sd_rtnl_message *m) {
>                  return r;
>          }
>  
> +        if(!netdev->tunnel_pmtudisc)
> +                pmtudisc = 0;

Hmm, you never initialized the variable if mtu disc is off, no?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list