MT#55283 Honour the hosts IPv4 TTL and IPv6 hop limit

This patch forces rtpengine to use the IPv4 TTL and IPv6 hop limits set
on the host for proxied packets in kernel mode.

Beforehand, the TTL was always set to a hardcoded value of 64. While
this is the default almost everywhere, it may be desirable to be able to
set a higher value. Especially when interfacing with complex carrier
backbone networks.

Closes #1860

Change-Id: I2ddf5752db541205d92f042db22eb738481e84a3
mr13.0
Tobias Schlager 2 years ago committed by Richard Fuchs
parent 1b5f899ff6
commit 98507cf414

@ -4988,6 +4988,9 @@ static int send_proxy_packet4(struct sk_buff *skb, struct re_address *src, struc
if (!net) if (!net)
goto drop; goto drop;
// honour the IPv4 TTL set via sysctl
ih->ttl = net->ipv4.sysctl_ip_default_ttl;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,10,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(6,10,0)
rt = ip_route_output(net, dst->u.ipv4, src->u.ipv4, tos, 0, 0); rt = ip_route_output(net, dst->u.ipv4, src->u.ipv4, tos, 0, 0);
#else #else
@ -5078,6 +5081,9 @@ static int send_proxy_packet6(struct sk_buff *skb, struct re_address *src, struc
if (!net) if (!net)
goto drop; goto drop;
// honour the IPv6 hop limit set via sysctl
ih->hop_limit = net->ipv6.devconf_dflt->hop_limit;
memset(&fl6, 0, sizeof(fl6)); memset(&fl6, 0, sizeof(fl6));
memcpy(&fl6.saddr, src->u.ipv6, sizeof(fl6.saddr)); memcpy(&fl6.saddr, src->u.ipv6, sizeof(fl6.saddr));
memcpy(&fl6.daddr, dst->u.ipv6, sizeof(fl6.daddr)); memcpy(&fl6.daddr, dst->u.ipv6, sizeof(fl6.daddr));

Loading…
Cancel
Save