From The Hacker News

You are viewing a single thread.
View all comments
15 points

Interesting, I didn’t know IPv4 addresses converted to hex could be used for anything.

permalink
report
reply
25 points

It’s all 1s and 0s at the end of the day

permalink
report
parent
reply
8 points

You can use a decimal number as well. It’s rare to see that form of URL though.

permalink
report
parent
reply
7 points
*

Dotted Decimal is just a human convention. IPs are just 32 bit numbers meaning binary digit, and octal, dotted decimal and Hex are all valid representations of that same number. Subnet masks work via binary math.

Almost every single thing you would use an IP address for, you can substitute dotted decimal for octal or hex representations.

permalink
report
parent
reply
1 point

We have PABXes that use VxWorks and it uses hex IPs to identify each ethernet port

Might be easier to use with lower-level stuff like pure C?

permalink
report
parent
reply
4 points
*

Nah, it’s easier in pretty much every language. It’s just a 32 bit number that can be compared with a standard “<=” or “=” comparison operator in pretty much every language out there and a single ASM instruction. Writing it as four smaller numbers joined with dots is just how it’s easy to display for humans.

Many make the mistake of thinking that IPv4 addressess are always encoded like that. The address “127.0.0.1” is just 2130706433 in decimal. Some tools even accept misformed addresses like “0.0.0.2130706433”. Security concerns come in to play when a program checks for local addresses by comparing the individual “127”, “0”, “0”, “1” parts (or eg. “192”, “168”, ““, ,””) and allow or deny access based on that for example. Another part of the software will likely just accept a misformed address and a malicious actor can circumvent the filtering from earlier.

permalink
report
parent
reply
1 point

Some tools even accept misformed addresses like “0.0.0.2130706433”

Is that because it’s just three octets of zero bits? What tools do this?

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 6.8K

    Monthly active users

  • 6.6K

    Posts

  • 180K

    Comments