lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 10 Mar 2017 10:12:36 +0000 From: Robert Shearman <rshearma@...cade.com> To: David Ahern <dsa@...ulusnetworks.com>, <davem@...emloft.net> CC: <netdev@...r.kernel.org>, "Eric W. Biederman" <ebiederm@...ssion.com>, roopa <roopa@...ulusnetworks.com> Subject: Re: [PATCH net-next v2 2/2] mpls: allow TTL propagation from IP packets to be configured On 10/03/17 02:54, David Ahern wrote: > On 3/7/17 5:46 PM, Robert Shearman wrote: >> @@ -78,6 +70,29 @@ static int mpls_xmit(struct sk_buff *skb) >> >> tun_encap_info = mpls_lwtunnel_encap(dst->lwtstate); >> >> + /* Obtain the ttl */ >> + if (dst->ops->family == AF_INET) { >> + if (tun_encap_info->ttl_propagate == MPLS_TTL_PROP_DISABLED) >> + ttl = tun_encap_info->default_ttl; >> + else if (tun_encap_info->ttl_propagate == MPLS_TTL_PROP_DEFAULT && >> + !net->mpls.ip_ttl_propagate) >> + ttl = net->mpls.default_ttl; >> + else >> + ttl = ip_hdr(skb)->ttl; > > After staring at that for a while, an explanation above this if {} else > {} section on the ttl selection will be very helpful. > Ok, would a comment like the following improve things sufficiently? /* Obtain the ttl using the following set of rules. * * LWT ttl propagation setting: * - disabled => use default TTL value from LWT * - enabled => use TTL value from IPv4/IPv6 header * - default => * Global ttl propagation setting: * - disabled => use default TTL value from global setting * - enabled => use TTL value from IPv4/IPv6 header */ Thanks, Rob
Powered by blists - more mailing lists