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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 10 Mar 2017 10:12:20 +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 1/2] mpls: allow TTL propagation to IP packets
 to be configured

On 10/03/17 02:00, David Ahern wrote:
> On 3/7/17 5:46 PM, Robert Shearman wrote:
>> @@ -244,24 +245,33 @@ static bool mpls_egress(struct mpls_route *rt, struct sk_buff *skb,
>>  		payload_type = ip_hdr(skb)->version;
>>
>>  	switch (payload_type) {
>> -	case MPT_IPV4: {
>> -		struct iphdr *hdr4 = ip_hdr(skb);
>> +	case MPT_IPV4:
>> +		if (rt->rt_ttl_propagate == MPLS_TTL_PROP_ENABLED ||
>> +		    (rt->rt_ttl_propagate == MPLS_TTL_PROP_DEFAULT &&
>> +		     net->mpls.ip_ttl_propagate)) {
>> +			struct iphdr *hdr4 = ip_hdr(skb);
>> +
>> +			csum_replace2(&hdr4->check,
>> +				      htons(hdr4->ttl << 8),
>> +				      htons(dec.ttl << 8));
>> +			hdr4->ttl = dec.ttl;
>> +		}
>>  		skb->protocol = htons(ETH_P_IP);
>> -		csum_replace2(&hdr4->check,
>> -			      htons(hdr4->ttl << 8),
>> -			      htons(dec.ttl << 8));
>> -		hdr4->ttl = dec.ttl;
>>  		success = true;
>>  		break;
>> -	}
>> -	case MPT_IPV6: {
>> -		struct ipv6hdr *hdr6 = ipv6_hdr(skb);
>> +	case MPT_IPV6:
>> +		if (rt->rt_ttl_propagate == MPLS_TTL_PROP_ENABLED ||
>> +		    (rt->rt_ttl_propagate == MPLS_TTL_PROP_DEFAULT &&
>> +		     net->mpls.ip_ttl_propagate)) {
>> +			struct ipv6hdr *hdr6 = ipv6_hdr(skb);
>> +
>> +			hdr6->hop_limit = dec.ttl;
>> +		}
>>  		skb->protocol = htons(ETH_P_IPV6);
>> -		hdr6->hop_limit = dec.ttl;
>>  		success = true;
>>  		break;
>> -	}
>
> What decrements the TTL if it is not propagated from MPLS to IP?
>

Good point. Will address in v3.

Thanks,
Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ