I found some code that is supposed to return the gateway address. However, when I run it, I get a traceback that makes no sense.
I'm getting an unknownhost exception but the traceback says addr is the wrong length. There is no such variable.
java.net.UnknownHostException: addr is of illegal length
at java.net.InetAddress.getByAddress(Unknown Source)
at java.net.InetAddress.getByAddress(Unknown Source)
at TestIfconfig.main(TestIfconfig.java:14)
Can someone tell me what is wrong or point me to a better way to get the gateway address? TIA.