Hacker Newsnew | past | comments | ask | show | jobs | submit | Dagger2's commentslogin

Note that even a MAC-derived link-local may not be unique, since the same MAC can be on both networks (e.g. with VLANs, or if you assign MACs to hosts instead of NICs).

Note you can also advertise a ULA prefix without the A flag. The advertisement tells other machines that the IP is on-link, and they can use their own GUA addresses to connect without needing a ULA address of their own.

You could also assign a single address (e.g. fd53::1/128) and advertise the corresponding prefix of fd53::1/128, so you don't even need a whole ULA prefix, just individual addresses. (This is sometimes useful if you use a router you can't configure and it's advertising a DNS server you don't want to use.)


mDNS on link-locals is what makes the "plug computers and printers into switch" case work. It would have been NetBIOS originally but mDNS is how it's done today.

I very much didn't test it, but this patch might do the job on Firefox (provided there's no code in the UI doing extra validation on top):

  --- a/netwerk/base/nsURLHelper.cpp
  +++ b/netwerk/base/nsURLHelper.cpp
  @@ -928,3 +928,3 @@ bool net_IsValidIPv4Addr(const nsACString& aAddr) {
   bool net_IsValidIPv6Addr(const nsACString& aAddr) {
  -  return mozilla::net::rust_net_is_valid_ipv6_addr(&aAddr);
  +  return true;
   }
Or if you actually wanted to do some validation, pass the address to getaddrinfo():

  bool net_IsValidIPv6Addr(const nsACString& aAddr) {
    struct addrinfo *res, hints = {.ai_flags = AI_NUMERICHOST};
    int err = getaddrinfo(aAddr.get(), nullptr, &hints, &res);
    if (err) return false;

    bool isValid = res[0].ai_family != AF_INET;

    freeaddrinfo(res);
    return isValid;
  }
This way it's valid if your OS considers it a valid address.

Routing tables don't work here, because the routing table looks something like:

  fe80::/64 dev eth0 proto kernel metric 256 pref medium
  fe80::/64 dev eth0.11 proto kernel metric 256 pref medium
  fe80::/64 dev eth0.13 proto kernel metric 256 pref medium
  fe80::/64 dev eth0.14 proto kernel metric 256 pref medium
  fe80::/64 dev eth0.15 proto kernel metric 256 pref medium
  fe80::/64 dev eth0.16 proto kernel metric 256 pref medium
Which interface's fe80::4 are you talking about? They all have an fe80::4.

What do you do in IPv4 or 6 when the metric is the same?

That is literally the reason for the metric. You set it if you need your routes to be deterministic.

You need to direct your IP stack which routes are important to you - your IP stack cannot read your mind! You could use a routing protocol and daemon to do the job for you but someone needs to tell it how to work.


They'd be more common if browsers didn't completely break handling them.

The most amazing part about this is that Microsoft used a public domain for it and then lost the domain registration.

And don't even care to make a serious effort to get it back. I suspect if they tried using the UDRP with a claim "we lost it by accident, cybersecurity risk, current owner is just squatting on it without actively using it" – they'd have quite decent odds of success, given the attitudes of the average UDRP arbitrator. The current holder would of course argue "you lost it more than a decade ago, you should be estopped by the passage of time" – but again, the average UDRP arbitrator would likely weigh the "cybersecurity risk" argument higher.

I've never really got why this is so complicated. My interpretation of [] syntax in URLs is "[ enters into a raw address mode", "] exits the raw address mode" and "the characters between the brackets are opaque address characters to be passed to getaddrinfo()".

(It basically has to be this way, or the URL syntax would need to be updated to support future address families with their own address formats. New address families can be loaded at runtime, including ones that didn't exist at the time your current software was compiled -- and this is handled properly by the BSD socket API -- so hardcoding possible address formats is incorrect.)

The _only_ character that needs special handling is ], and if you're willing to declare that you can't be bothered to support link-local addresses at all then declaring that you'll support anything except addresses containing a "]" should be far easier.


Previously on HN:

Parsing IPv6 Addresses Crazily Fast with AVX-512: https://news.ycombinator.com/item?id=48245311

Parsing IPv6 Addresses Crazily Fast with AVX-512: https://news.ycombinator.com/item?id=48261386

Parsing IPv6 Addresses Crazily Fast with AVX-512: https://news.ycombinator.com/item?id=48294662

Parsing IPv6 Addresses Crazily Fast with AVX-512: https://news.ycombinator.com/item?id=48361058 (this page)

With two comments over four stories, I'm not sure if this article is popular or unpopular.


Real in what sense?

Lots of people have come up with alternate L3 protocols for the Internet. For example, check out [1] which goes up to 999.999.999.999.999, or [2] which gets updated with some typo fixes every 6 months each time it's about to expire.

Someone did post another one of these recently, but it's just a random person on the Internet. The IETF's draft database is more or less a pastebin service -- anyone can upload something there without it being a thing that's being taken seriously.

Sometimes you get drafts like [3] as a demonstration of that.

[1] https://datatracker.ietf.org/doc/html/draft-eromenko-ipff-05

[2] https://datatracker.ietf.org/doc/draft-chen-ati-adaptive-ipv...

[3] https://datatracker.ietf.org/doc/html/draft-meow-mrrp


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: