Hi. I have had a need to know the number of the client port after successful
exec 4<>/dev/tcp/${host}/${port} [..] The attached patch stores the local, client port in the variable LOCALPORT. Would you accept this new feature? We need it due to specific on-site security considerations. There is another benefit: after last discussion about tempfile this would give another source of natural randomness along with $$ and $!. Employing the kernel for generating the random sequence is the most portable way to get pseudo random numbers, since most kernels randomize pids and ports to some extent. The variable can go by any other name, and I am not sure about the need for extra #ifdefs concerning ipv6 (I assumed that if we have networking we also have ipv6, and in both cases struct sockaddr_storage). cheers, pg
0001-store-local-port-in-network-redirections.patch
Description: Binary data