Advertisement:

Author Topic: IPv6 support  (Read 30790 times)

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
IPv6 support
« on: June 29, 2011, 03:25:36 PM »
Link to Mod

IPv6 support for SMF 2.0+ Only.

SMF 2.1 Upgrades are not compatible with this and will cause all the IPv6s to be loss during the upgrade.

This customization will add support for the IPv6 enabled clients in SMF 2.0.  Specifically posts, ip tracking and ban management have been changed.  Member search from the admin panel does support this by default.

Due to the size and necessity of the changes, please do not continue with installation if any change should fail the test.  This may lead to unexpected results or a unusable forum.

Note: During uninstallation, all IPv6 enabled bans will be disabled.  This customization makes attempts to track those changes in columns it adds to the ban_items table.  If you remove the database changes, this tracking will be lost.  In addition upon reinstallation this customization makes attempts to re-enable those bans that should still be active.

Note: Currently you are unable to link via iurl/url or auto linking ipv6 urls.  This is due to the square brackets that ipv6 addresses are enclosed in.  However this doesn't affect domains.

Thanks to Ray Soucy's for his IPv6 functions he wrote and allowing usage of them in this customization.

This mod is open source at GitHub!.  See the source code, fork the project, suggest improvements and download old versions.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline butchs

  • SMF Hero
  • ******
  • Posts: 1,724
  • Lost 7GB bandwidth!
    • EastCoastRollingThunder
Re: IPv6 support
« Reply #1 on: July 30, 2011, 07:10:59 PM »
Nice mod.  I look forward to trying this mod.

One question:  How would another mod be able to check when ipv6 is being handled by the mod? Would it be noticeable somewhere?
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #2 on: July 30, 2011, 10:24:49 PM »
Is there any mod that explicitly handles IPs in a non normal way?  Unlike ban management, most other IP storing should be in a proper sized data set. Other than that, you could do a ipv6 regex check.  For simple checks you could just test to see if : exists in the ip address.   SMF does validate that the IP address is a valid IPv4 and this mod validates a IPv6 address.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Stevenn

  • Newbie
  • *
  • Posts: 3
Re: IPv6 support
« Reply #3 on: August 27, 2011, 03:34:31 PM »
8.   Add Before   ./Sources/QueryString.php   Test failed

Help? I really need IPv6 for my site (:

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #4 on: August 30, 2011, 05:18:17 PM »
Hello,
Do you have any other mods installed?

If you click on the arrow on the left, see which one of the edits on that file is failing, then click the edit icon.  That should give me information about what code it can't find.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline yellowgoat

  • Newbie
  • *
  • Posts: 1
Re: IPv6 support
« Reply #5 on: September 01, 2011, 09:26:25 PM »
Hello,
Do you have any other mods installed?

If you click on the arrow on the left, see which one of the edits on that file is failing, then click the edit icon.  That should give me information about what code it can't find.

Had the same issue.  It couldn't find
Code: [Select]
?>
on the final modification of  ./Sources/QueryString.php which inserted the functions.  Perfectly clean install.  This was the first mod I attempted to add.

Offline Fisch.666

  • Jr. Member
  • **
  • Posts: 205
Re: IPv6 support
« Reply #6 on: December 14, 2011, 10:54:02 AM »
Hi!

I've installed this mod on my smf 2.0.1 / portamx 1.4.5 without an error in the package manager ang got this SQL Error:

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BETWEEN bi.ip_low2 AND bi.ip_high2)
AND ( BETWEEN bi.ip_low3 AND bi.ip_hi' at line 7
File: /Sources/Security.php
Line: 344

After revert the Security.php back my page works again. Any ideas how i can fix this?

Thanks in advance for a reply.

*Edit*

Ah, and there is a small typo in the install file for the Security.php. This:

Code: [Select]
<?php

is replaced by this:

Code: [Select]
c<?php

which makes no sense.
« Last Edit: December 14, 2011, 12:19:43 PM by Fisch.666 »

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #7 on: December 17, 2011, 12:25:21 PM »
I don't know how that c before <?php would of gotten there.  I make no such edit in the mod.  However removing it I don't think will fix the issue.  Looks like a query has gone wrong in that file.  Do you have that file before you reverted it?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Fisch.666

  • Jr. Member
  • **
  • Posts: 205
Re: IPv6 support
« Reply #8 on: December 19, 2011, 09:53:52 AM »
Hi!

Thanks for your reply. I've attached the file before the revert, but i think this should be correct.

The c before the <?php seems to be a typo in the install file. If you parse the mod on:

http://custom.simplemachines.org/mods/index.php?mod=3051

for 2.0 and 2.0.1 you get this edit in for the Security.php

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #9 on: December 24, 2011, 02:25:23 PM »
I repackaged the mod and reuploaded it.  See if that provides any better luck.  I can't find that stray c in my repository anywhere. https://github.com/jdarwood007/smfmod_ipv6
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline eric1234

  • Full Member
  • ***
  • Posts: 683
Re: IPv6 support
« Reply #10 on: January 14, 2012, 03:23:13 PM »
Installed. So how can i know that my site is supported with ipv6? Is there any sign that tell my forum is supported ipv6 so that i can convince my members? :)

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #11 on: January 15, 2012, 12:58:29 PM »
You would have to ask your host if the server you are on is IPv6 enabled and then you would need to add a AAAA to your dns for that IPv6 address.  If you maintain your DNS records with your host, they would be able to do that if the box you are on is IPv6 capable.
If you have a VPS or dedicated server, you could setup a tunnel if your host doesn't support IPv6 yet. tunnelbroker.net is what I use to tunnel to IPv6 from my home connection since my ISP doesn't support IPv6 yet.  I've got that configured on my router so all my network computers can use IPv6.  The process is the same for setting it up on your VPS/dedicated.  Just need to configure it on the server instead.  Your OS/distro and network setup will depend on how you modify the network configurations to set that up.

This mod only makes it so SMF knows how to understand and handle IPv6 addresses.  It can't change what isn't enabled/setup on the server and DNS itself.
« Last Edit: January 15, 2012, 01:02:08 PM by SleePy »
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline eric1234

  • Full Member
  • ***
  • Posts: 683
Re: IPv6 support
« Reply #12 on: January 16, 2012, 03:27:33 PM »
You would have to ask your host if the server you are on is IPv6 enabled and then you would need to add a AAAA to your dns for that IPv6 address.  If you maintain your DNS records with your host, they would be able to do that if the box you are on is IPv6 capable.
If you have a VPS or dedicated server, you could setup a tunnel if your host doesn't support IPv6 yet. tunnelbroker.net is what I use to tunnel to IPv6 from my home connection since my ISP doesn't support IPv6 yet.  I've got that configured on my router so all my network computers can use IPv6.  The process is the same for setting it up on your VPS/dedicated.  Just need to configure it on the server instead.  Your OS/distro and network setup will depend on how you modify the network configurations to set that up.

This mod only makes it so SMF knows how to understand and handle IPv6 addresses.  It can't change what isn't enabled/setup on the server and DNS itself.
I see. I will confirm with my host. So if my host's server is not ready for ipv6, then what we shall do?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #13 on: January 16, 2012, 04:01:26 PM »
You won't be able to make use of the feature this mod adds.

As I said though, if you have a VPS or dedicated server, you can setup a IPv6 tunnel between your server and your IPv6 broker.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline gamerzworld

  • Semi-Newbie
  • *
  • Posts: 21
Re: IPv6 support
« Reply #14 on: February 09, 2012, 09:30:52 PM »
Getting a "The database value you're trying to insert does not exist: ip_low5" when trying to add a regular IPv4 ban and IPv6 bans do not show an IP address in the trigger list when added. Looking at the database, all bans have a value of 1 for is_ipv6 and even IPv6 bans have just a single 0 for each IPv6 address set. Also, the uninstaller for the database just gives me an error of "Database error, given array of integer values is empty. (bans)". I'm running SMF 2.0.2.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #15 on: February 15, 2012, 02:19:02 PM »
Hmm, looks like the ip2range function is causing this.

Open Subs.php and find:
Code: [Select]

return $ip_array;
}

// Lookup an IP; try shell_exec first because we can do a timeout on it.
function host_from_ip($ip)

Is there this code before that?:

Code: [Select]

// Makes it simpiler to work with.
$ip_array[5] = array('low' => 0, 'high' => 0);
$ip_array[6] = array('low' => 0, 'high' => 0);
$ip_array[7] = array('low' => 0, 'high' => 0);
$ip_array[8] = array('low' => 0, 'high' => 0);
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline supersasho

  • Semi-Newbie
  • *
  • Posts: 13
Re: IPv6 support
« Reply #16 on: June 19, 2012, 09:35:06 AM »
Hi, i've got a similar problem like user Fish.666. When i try to install this mod there's an error with ./Sources/QueryString.php. Any ideas?

Code: [Select]
Code: (Find) [Select]

?>
Code: [Select]
Code: (Add Before) [Select]
// Working with them as if they where IPv4 numbers, makes it SMF compatible.
function smf_ipv6_to_ints($ip)
{
   // Expand the IP out.
   $ip = explode(':', smf_ipv6_expand($ip));

   $new_ip = array();
   foreach ($ip as $int)
      $new_ip[] = hexdec($int);

   return implode($new_ip, '-');
}


/**
 * IPv6 Address Functions for PHP
 *
 * Functions to manipulate IPv6 addresses for PHP
 *
 * Copyright (C) 2009 Ray Patrick Soucy
 *
 * LICENSE:
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package   inet6
 * @author    Ray Soucy <rps@soucy.org>
 * @version   1.0.1
 * @copyright 2009 Ray Patrick Soucy
 * @link      http://www.soucy.org/ [nofollow]
 * @license   GNU General Public License version 3 or later
 * @since     File available since Release 1.0.1
 */
function smf_ipv6_expand($addr, $strict_check = true)
{
   /* Check if there are segments missing, insert if necessary */
   if (strpos($addr, '::') !== false)
   {
      $part = explode('::', $addr);
      $part[0] = explode(':', $part[0]);
      $part[1] = explode(':', $part[1]);
      $missing = array();
      for ($i = 0; $i < (8 - (count($part[0]) + count($part[1]))); $i++)
         array_push($missing, '0000');
      $missing = array_merge($part[0], $missing);
      $part = array_merge($missing, $part[1]);
   }
   else
      $part = explode(":", $addr);

   /* Pad each segment until it has 4 digits */
   foreach ($part as &$p)
      while (strlen($p) < 4)
         $p = '0' . $p;

   unset($p);

    /* Join segments */
   $result = implode(':', $part);

   /* Quick check to make sure the length is as expected */
   if (!$strict_check || strlen($result) == 39)
      return $result;
   else
      return false;
}

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,097
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: IPv6 support
« Reply #17 on: June 23, 2012, 02:57:34 PM »
I've updated that mod.  Its possibly a bug with how it was searching for the end of that file.  I've changed it to use the appropriate method.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline BaghdadGhost

  • Jr. Member
  • **
  • Posts: 386
  • Gender: Male
Re: IPv6 support
« Reply #18 on: June 27, 2012, 08:49:17 PM »
Hi Sleepy,

forgive me for the question.

you stated that this mod changes the way ban members. so does it makes it better for admins?

I am not a pro in technology, but as far as I understand a lot of my members are from countries where they use internet providers with IPv6 and when I ban someone by IP usually effect other members. unlike here in the states where each one has a unique ip address.

will this mod help me controlling those members better in term of ban?

I have to ask my host first about the requirements you mentioned in one of your replies.

thanks in advance.

 

Offline BaghdadGhost

  • Jr. Member
  • **
  • Posts: 386
  • Gender: Male
Re: IPv6 support
« Reply #19 on: June 27, 2012, 08:58:59 PM »
oh forgot one thing

does this mod have anything to do with this site


http://ipv6-test.com/validate.php