vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Miscellaneous Hacks - Lowercase a-f in IPv6 Addresses (https://vborg.vbsupport.ru/showthread.php?t=325991)

JamesC70 01-14-2018 10:00 PM

Lowercase a-f in IPv6 Addresses
 
1 Attachment(s)
I upgraded my forum from vB 3.8.9PL1 to 3.8.11, and noticed that 3.8.11 displays IPv6 addresses with uppercase letters on Who's Online.

3.8.9PL1 didn't do this, and none of the other websites I visit use uppercase letters in IPv6 addresses.

I looked into it, and RFC5952 Section 4.3 says that IPv6 addresses are to use lowercase letters a-f.

So, if this irritates you as much as it did me, here's the fix.

1. Open includes/class_core.php and search for function compress_ip. It should appear at line 3982.

2. 24 lines below, at line 4006, you should see:
PHP Code:

return strtoupper(inet_ntop($ipx)); 


Change "upper" to "lower", so that line 4006 now reads:
PHP Code:

return strtolower(inet_ntop($ipx)); 

3. FTP the edited file to your server, and inspect any IPv6 address you may see on Who's Online to verify that it now displays a-f as lowercase letters.

Note, this will not fix any IPv6 hostname lookup issues you may experience. That is a webhost issue; if your webhost doesn't yet support IPv6 then their hands are also tied. I can post a workaround if anyone needs one, but it doesn't fully integrate into Who's Online.

Stingray27 01-15-2018 12:45 PM

That RFC is only a recommendation, and conflicts with the full RFC 4291.

https://tools.ietf.org/html/rfc4291 (IP Version 6 Addressing Architecture)

Section 2.2

JamesC70 01-15-2018 02:03 PM

Quote:

Originally Posted by Stingray27 (Post 2592276)
That RFC is only a recommendation, and conflicts with the full RFC 4291.

The second line of 4291, just below where you can choose text or PDF, says "Updated by: 5952".

If we read the Abstract of 5952, it is written to correct the problems of 4291.

The IETF clearly intends 5952 to supersede 4291. Whether you follow 5952 is your choice (5952 requires all systems to accept a valid IPv6 address if it conforms with 4291) but vBulletin should have been 5952 compliant from the start of its IPv6 support. ;)

Stingray27 01-15-2018 04:35 PM

It may intend to replace it [at some point] but it doesnt atm. :)
Why whould vb comply with something thats just a proposed recommendation ?

As far as I can tell from 5952, the whole "use lowercase" is just a 50/50 random choice based on the fact unix systems are case sensitive. Uppercase would be equally valid.

As long as your software (e.g. vBulletin) is consistant in its use of one or the other, it doesnt really matter which way you go.

Its all just preference really, I find lowercase looks really horrible & odd. ;)

JamesC70 01-15-2018 06:50 PM

Quote:

Originally Posted by Stingray27 (Post 2592282)
As long as your software (e.g. vBulletin) is consistant in its use of one or the other, it doesnt really matter which way you go.

Its all just preference really, I find lowercase looks really horrible & odd. ;)

I have two vB 3.8 forums, and it bothered me that one shows lowercase IPv6 but the other shows uppercase on Who's Online. This inconsistency is what bothered me; if I only had one forum then I may never have noticed the change. :)

But if IB ever releases a hypothetical 3.8.13 (intentionally skipping 3.8.12) that reverts IPv6 to lowercase, now you know how to change it back to uppercase. :)

All good?

final kaoss 04-19-2018 08:17 PM

Posting here to say that you can do the same modification in vbulletin 4 forums.

This will be on line 6436

PHP Code:

return strtoupper(inet_ntop($ipx)); 

Replace it with the code above

PHP Code:

return strtolower(inet_ntop($ipx)); 

JamesC70, feel free to post this to the vbulletin 4 mods section if you like.


All times are GMT. The time now is 06:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01185 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete