this post was submitted on 15 Nov 2023
1006 points (95.6% liked)

Programmer Humor

19452 readers
131 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 311 points 11 months ago (45 children)

Ok. This covers every ipv6 and ipv4 address.

"^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?\s*$"

[–] [email protected] 51 points 11 months ago (20 children)

IPv6 was a mistake. We should have just added an addition octet

[–] [email protected] 75 points 11 months ago (4 children)

That would allow for like, 2 trillion devices? Feels like a bandaid, my dude. Next you’re gonna suggest a giant ice cube in the ocean once a year to stop global warming.

[–] [email protected] 13 points 11 months ago (1 children)

So add two more octets:

Moat companies will still just use something like 10.0.13.37.0.1

[–] [email protected] 11 points 11 months ago (2 children)

IPv6 is not made with internal networks in mind lol

[–] [email protected] 1 points 11 months ago

You can use a ULA if you want to. That's essentially the IPv6 equivalent of a private IP.

Why though? Having the same IP for both internal and external solves a bunch of issues. For example, you don't need to use split horizon DNS any more (which is where a host name has a different IP on your internal network vs on the internet). You just need to ensure your firewalls are set up properly, which you should do anyways.

[–] [email protected] -2 points 11 months ago (1 children)

Never claimed it was, please quote me where I said as much

[–] [email protected] 17 points 11 months ago (1 children)

My dude, you used the 10.xx private IP as an example. Why wouldn’t they assume you were referring to internal networks?

[–] [email protected] -2 points 11 months ago (1 children)

I thought it was pretty clear with me adding 13.37 that I was making a joke, the earlier post spoke about how just adding one octet would still be too few addresses, so I joked about adding one more octet.

[–] [email protected] 3 points 11 months ago

I’m only pointing out why the other poster would make the assumption you were referring to an internal network. Do with it what you will.

[–] [email protected] 9 points 11 months ago (1 children)
[–] [email protected] 6 points 11 months ago (1 children)

Hurricanes cannot cross the equator. The equator is an imaginary line, and hence has zero mass. We can end every hurricane using zero point zero energy (0.0).

[–] [email protected] 5 points 11 months ago (1 children)
[–] [email protected] 2 points 11 months ago
[–] [email protected] 4 points 11 months ago* (last edited 11 months ago)

You could follow this logic and add 2 alphanumeric digits before 4 numeric octets. E.g. xf.192.168.1.1

This would at least keep it looking like an IP and not a Mac address. Another advantage would be graceful ipv4 handling with a reserved range starting with "ip" like ip.10.10.10.1

load more comments (15 replies)
load more comments (39 replies)