ip_to_network generates bad subnet mask
Brought to you by:
cleverly
I'm no ip networking expert, but it appears that ::tunnel::ip_to_network malfunctions, with the side effect that all connection attempts to jenny from jack are denied.
For example, "::tunnel::ip_to_network 127.0.0.1" returns "0.0.0.1"
If the intent of the proc is to return the input address with the host id bits turned to 0, this is clearly wrong.
A single line change makes it work as I expected it to:
change:
set netmask 0x[format %08x [expr {0x80000000 >> ($mask - 1)}]]
to:
set netmask 0x[format %08x [expr {0xffffffff << (32 - $mask)}]]