Dave Hodgkinson
2018-06-13 10:57:05 UTC
Please help a chap out.
Iâve been wrestling with NetAddr::IP::Lite, NetAddr::IP, Net::IP, Net::IP::Util and Iâve not been able to wrestle them into doing what I want.
Basically, if I have an address of 192.168.1.65 with a gateway of 192.168.1.254 Iâd like to know if theyâre on the same subnet. Same with 172.16.10.65 and 172.16.254.254 for example. Is this trivial logic from the rfcs? Should I just check the first two bytes are the same? Wrong but trivial!
Ta,
Iâve been wrestling with NetAddr::IP::Lite, NetAddr::IP, Net::IP, Net::IP::Util and Iâve not been able to wrestle them into doing what I want.
Basically, if I have an address of 192.168.1.65 with a gateway of 192.168.1.254 Iâd like to know if theyâre on the same subnet. Same with 172.16.10.65 and 172.16.254.254 for example. Is this trivial logic from the rfcs? Should I just check the first two bytes are the same? Wrong but trivial!
Ta,