[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Changing TTL after socket is connected


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++

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

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!


Reply to: