Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing TTL after socket is connected

32 views
Skip to first unread message

Tim Woodall

unread,
May 1, 2023, 12:30:05 PM5/1/23
to
Hi,

If I have a SOCK_STREAM that is connected and working, is/should it be
possible to change the TTL before sending the next packet? (C++
applicatiom)

If I have to I'll resort to SOCK_RAW, but I don't want to have to deal
with all of the required headache of setting up a TCP connection so I
can mangle the TTL on a single packet if I don't need to.

My testing suggests that I cannot change the TTL of a connected socket -
but I'm not sure if that's because I cannot do this or whether it's
because I'm doing something wrong, this isn't something I've attempted
before...

setsockopt(sock, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) succeeds, but
setting a ttl of 1 - when the target is 15 hops away, and the packet
still gets there!


Tim.
0 new messages