Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

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

Closed
westbywest opened this issue Jun 21, 2018 · 2 comments
Closed

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

westbywest opened this issue Jun 21, 2018 · 2 comments

Comments

@westbywest
Copy link

westbywest commented Jun 21, 2018

ip2=$(expr $ip2 % 32 + 96)

ip4=$(expr $ip4 - $(expr $ip4 % 64 - $ip4 % 32))

The printf lines above already convert hex to decimal. This arithmetic yields incorrect values.

@colindean
Copy link
Member

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

@westbywest
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants