Browse Source

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
rfuchs/test
Tobias Schlager 1 year ago
committed by Richard Fuchs
parent
commit
98507cf414
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      kernel-module/xt_RTPENGINE.c

+ 6
- 0
kernel-module/xt_RTPENGINE.c View File

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


Loading…
Cancel
Save