Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
IPV6 Support in VB3 Details »»
IPV6 Support in VB3
Version: 1.0.0, by wootalyzer wootalyzer is offline
Developer Last Online: Apr 2012 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.x Rating:
Released: 07-28-2009 Last Update: 07-28-2009 Installs: 31
Re-useable Code Code Changes Additional Files  
No support by the author.

UPDATE - This mod works with vBulletin 3 AND vBulletin 4!

About

Ok, so let's get started. Got a web server that resolves IP addresses as ipv6? Don't want to remove that ipv6 functionality just so vBulletin will work well? Well, this mod will take care of all of that for you.

How it works

vBulletin 3 and 4 are (from a coding standpoint) completely reliant upon ipv4. Classes are coded all over the place which expect addresses to be in ipv4 format. This mod runs before ANYTHING in vB gets a chance to load and does the following:

- If the address is in ipv4-over-ipv6 format, it simply dumps the ipv4 portion of the address into vbulletin. Done. Simple as pie.
- If the address is in standard ipv6 format (it's a real ipv6 address), it generates a "psudo-ipv4" address to represent the ipv6 address. This "psudo-ipv4" address is in a reserved ipv4 address space, so it shouldn't interfere with any of the real ipv4 addresses, and is generated from a hash of the ipv6 address (so each of the ipv6 addresses should hopefully resolve to their own, unique ipv4 address).

And... that's about it! vB continues on it's merry way treating everyone's ip as a standard ipv4 address.

WATCH OUT!

See someone on your forum with an IP address starting in 204. after installing this mod? That means they are actually accessing your site via an ipv6 address, and the address LISTED doesn't really mean anything.

Installation

Not scared about what we just covered? Good, let's get started.

1. Upload ipv6_fix.php to your forum/includes directory.
2. Edit your includes/init.php file (VERY carefully)

Find

Code:
require_once(CWD . '/includes/class_core.php');
And insert JUST ABOVE IT

Code:
require_once(CWD . '/includes/ipv6_fix.php');
3. Every time you upgrade vB, repeat step 2.

And you're done!

This mod should have no effect if your web server is handling connections as ipv4 addresses. [S]This mod is no replacement for the REAL ipv6 support coming in vB4, so upgrade as soon as it is released![/S] Looks like ipv6 didn't make it into vB4 either -- On lives the mod!

Have fun

Download Now

File Type: php ipv6_fix.php (974 Bytes, 306 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:

Comments
  #2  
Old 07-29-2009, 08:30 AM
flapjack flapjack is offline
 
Join Date: Jan 2006
Location: Tampa Bay, Florida
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nifty little code, actually.

I don't know anyone who's using ipv6 yet, so it's no use to me, but I thought I'd give you kudos for working on this.
Reply With Quote
  #3  
Old 11-09-2009, 12:56 AM
accludetuner accludetuner is offline
 
Join Date: Jun 2009
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IPv6 is right around the corner. Installing now. Thanks
Reply With Quote
  #4  
Old 09-11-2010, 03:07 PM
heugabel heugabel is offline
 
Join Date: May 2006
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you
Reply With Quote
  #5  
Old 10-15-2010, 10:25 AM
digibyte digibyte is offline
 
Join Date: Mar 2007
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Vote for IPv6 support in vBulletin: http://tracker.vbulletin.com/browse/VBIV-9397
Reply With Quote
  #6  
Old 02-05-2011, 09:40 AM
PossumX's Avatar
PossumX PossumX is offline
 
Join Date: Oct 2006
Location: NE USA
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by digibyte View Post
Vote for IPv6 support in vBulletin: http://tracker.vbulletin.com/browse/VBIV-9397
Well, now they may do something about this, but, then again, who knows. Until supported natively by vB4, I have installed this simple work around. Thanks!!

Oh yeah, click on the vB tracker link and VOTE, as the fact that this has yet to even be scheduled (or at least planned to be) seems a bit inane for the "...largest international developer and distributor of proprietary community bulletin board software." (quoted from IB's site: http://www.internetbrands.com/our-brands/licensing/ )
Reply With Quote
  #7  
Old 02-05-2011, 10:41 AM
Monarch.V Monarch.V is offline
 
Join Date: Nov 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:up: Thanks
Reply With Quote
  #8  
Old 02-06-2011, 02:35 PM
traen traen is offline
 
Join Date: Oct 2009
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed on 4.1.1 thanks.
Reply With Quote
  #9  
Old 05-24-2012, 06:47 PM
empire10 empire10 is offline
 
Join Date: Oct 2003
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately this does not work anymore in 4.2. Is there any other workaround to use?
Reply With Quote
  #10  
Old 05-31-2012, 12:40 PM
GHDpro's Avatar
GHDpro GHDpro is offline
 
Join Date: Mar 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by empire10 View Post
Unfortunately this does not work anymore in 4.2. Is there any other workaround to use?
I've just hacked together the following, which seems to be working (in vB 4.2):

PHP Code:
function FixIPv6($ip) {
  
// No colon = No IPv6 (return unaltered)
  
if (stristr($ip,':') === false)
    return 
$ip;
  
// Remove IPv6 encapsulation from IPv4 address
  
if (strtolower(substr($ip,0,7)) == '::ffff:')
    return 
substr($ip,7);
  
// Else: Pack IPv6 address into IPv4 address
  
$crc sprintf('%x',crc32($ip));
  
$b ord(pack('H*',substr($crc,0,2)));
  
$c ord(pack('H*',substr($crc,2,2)));
  
$d ord(pack('H*',substr($crc,4,2)));
  
$ip '10.'.$b.'.'.$c.'.'.$d;
  return 
$ip;
}

$_SERVER['REMOTE_ADDR'] = FixIPv6($_SERVER['REMOTE_ADDR']);
$this->ipaddress FixIPv6($this->ipaddress); 

Put above code somewhere in /includes/config.php (the normal vB config file), for example just before the last line (with ?>).

Warning: you might want to make a backup of the config file as messing up editing it will probably cause your forum to stop loading (just blank pages).

I'm also not 100% sure if putting the hack in config.php is quite the right location, as ideally it should of course be run before any vB code that uses IP addresses. But (in v4.2) at least the config file is included (executed) right before the IPADDRESS constant is defined (from the $this->ipaddress variable), so it should work alright.

My main motivation for trying to put it in the config file is that you can now easily upgrade your forum without the need to re-apply the hacks to init.php (which the plugin does require every time).

Note that in my solution I've changed the way IPv6 addresses are encoded; so encoded IPv6 will not look the same as the plugin.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:12 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04746 seconds
  • Memory Usage 2,325KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete