pittmesh / ip-calculator

A browser-based calculator for determining PittMesh IP addresses
http://www.pittmesh.net/ipcalc
1 stars 0 forks source link

mm-mac2ipv4.sh incorrect does multiple hex2dec conversions #28

Closed westbywest closed 6 years ago

westbywest commented 6 years ago

https://github.com/pittmesh/ip-calculator/blob/954e2e39cce62a66f687337f42e0d82a8725f6f9/mm-mac2ipv4.sh#L90 https://github.com/pittmesh/ip-calculator/blob/954e2e39cce62a66f687337f42e0d82a8725f6f9/mm-mac2ipv4.sh#L91 The printf lines above already convert hex to decimal. This arithmetic yields incorrect values.

colindean commented 6 years ago

What was your reason for closing? Is this not actually occurring?

westbywest commented 6 years ago

See issue #29. The arithmetic for modulo + offset is presumably by design. Underlying problem affecting me was a discrepancy in order of operations.