Page MenuHomeFreeBSD

Fix ARIN -> RIPE referrals in whois(1)
AcceptedPublic

Authored by mail_fbsd2.e4m.org on Tue, Sep 15, 4:23 AM.
Tags
None
Referenced Files
F174712170: D59693.diff
Mon, Oct 5, 10:07 AM
Unknown Object (File)
Sat, Oct 3, 6:26 AM
Unknown Object (File)
Sat, Oct 3, 6:26 AM
Unknown Object (File)
Sat, Oct 3, 4:11 AM
Unknown Object (File)
Sat, Oct 3, 2:48 AM
Unknown Object (File)
Fri, Oct 2, 10:04 PM
Unknown Object (File)
Thu, Oct 1, 5:10 AM
Unknown Object (File)
Sat, Sep 26, 8:13 PM
Subscribers

Details

Reviewers
pouria
Summary

For some whois queries (e.g. whois 137.31.32.184) the referral from ARIN to RIPE does not work.
This is my attempt to fix it. Instead of "ResourceLink:" one could also use "ReferralServer:".

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

michaelo added a subscriber: michaelo.

@pouria Is this something you can review? I am totally unknowledgeable here.

We should migrate to rfc9083 sooner or later...
Also please rebase it to main. I can't test it.

usr.bin/whois/whois.c
106

Use ReferralServer instead, unfortunately, it's not formal but the only thing that is referenced in a RFC.
See: RFC7485 Sec 4.3

Also, it's not specific to RIPE, it used by ARIN in general.
For example:

whois -a 1.1.1.1
usr.bin/whois/whois.c
104–107

I just tested it, and I think we should remove all ReferralServer lines and add a single ReferralServer: without any prefix. This should do the job.

For testing:
whois -aR 5.159.192.0

Alternatively, we could simply add another WHOIS_REFERRAL("ReferralServer:"), below it to prioritize the ReferralServers with a specified protocol. However, that would be a bit ugly.

usr.bin/whois/whois.c
104–107

When only using one "ReferralServer:" this breaks stuff when, for example, "rwhois://" is prepended, like "whois 146.115.106.228".
I don't know if chopping off everything before :// would be OK in all cases. So I think the "ugly" version might be ugly but should work.

usr.bin/whois/whois.c
104–107

Go head, I'm ok with the other one too.

Use "ReferralServer" instead of "ResourceLink"

This revision is now accepted and ready to land.Sun, Sep 20, 5:03 PM