ipv6

Problem Converting ipv6 to ipv4

I have some code in an asp.net app that needsto get the ipv4 address of the client computer (the users are all on our own network). Recently we upgraded the server the app runs on to windows 2008 server. Now the Request.UserHostAddress code returns the ipv4 when the client is on an older OS and ipv6 when they are on a newer OS (Vista and...

Store IPv6 in database

What's the best practise to store IP's with PHP in MySQL database? There's a function called ip2long - but this is just for IPv4. But what about IPv6? I know a php function that is for IPv6 IP's, but it doesn't work on Windows with PHP < Version 5.3 ...

Python 2 and IPv6

I'm trying to enable IPv6 in a Python 2 application and am running into trouble. Whenever I try to bind to an IPv6 socket, a socket.error: getsockaddrarg: bad family exception is thrown. I can reproduce the error simply by doing: import socket s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) s.bind(('', 12345)) This code work...

Detect If IPv6 is Enabled on Windows Machines

Hi Folks, I am writing a powershell script that will act as a build compliance test for our servers. One of the things I need to do is detect if IPv6 networking has been disabled. WMI indicates that this information can be found in the IPAddress Property of Win32_NetworkAdapterConfiguration but can be both IPv6 or IPv4. This does not g...

Ipv6 Packet Rewriting and Caching

I have a router running Linux that acts as the central gateway to the Internet for a network of embedded devices that use IPv6 to communicate. I would like to intercept, inspect, and rewrite every packet that goes in and out from the Internet to this subnetwork. The reason I need to do this is that I want to create a transparent (to both...

GetHostEntry.AddressList[0] returns ::1 on current Windows version even with IPv6 off. Can I change this?

I'm using a third party library suite that was stupidly hard-coded to call GetHostEntry.AddressList[0] for a local IP address. It is also not written to support IPv6. I disabled IPv6 on all my network interfaces, but AddressList[0] in my test program (and in the 3rd party libraries) still returns {::1} rather than my first IPv4 address. ...

How do I enable IPv6 support in LWP?

The following code ... my $user_agent = LWP::UserAgent->new; my $request = HTTP::Request->new(GET => $url); my $response = $user_agent->request($request); if ($response->is_success) { print "OK\n"; } else { die($response->status_line); } .. will fail with .. 500 Can't connect to <hostname> (Bad hostname '<hostname>') .. if ...

dual-stack ipv6/ipv4 on localhost

I have an ipv4 server that only accepts connections over localhost (using INADDR_LOOPBACK). I'd like to convert this server to be dual-stack ipv6/ipv4. However, using in6addr_loopback only accepts connections to ::1. I've found that I can accept ipv4 and ipv6 connections simultaneously using in6addr_any, but as this also allows connec...

Device auto discovery in IPv6/IPv4 network

We have Win CE IPv6/IPv4 devices installed in a room and connected to a network. Every now and then a person would come with a laptop, plug it into the network and run a diagnostics program. This program should be able to somehow auto find or discover all those devices. The catch is that device IPs are unknown to the diag program. I've ...

How to calculate an IPv6 IP Number?

I'm adding GeoIP tracking to WCF Web Service using MaxMinds' GeoIP Lite Country. All works well for their IPv4 database but they don't give any samples to calculate an IPv6 IP Number. I've contacted them and they said to use a search engine. Anyone have a sample they're willing to share? Any language will do. ...

Converting C++ TCP/IP applications from IPv4 to IPv6. Difficult? Worth the trouble?

Over the years I've developed a small mass of C++ server/client applications for Windows using WinSock (Routers, Web/Mail/FTP Servers, etc... etc...). I’m starting to think more and more of creating an IPv6 version of these applications (While maintaining the original IPv4 version as well, of course). Questions: What pitfalls might I...

WCF Duplex net.tcp issues on win7

We have a WCF service with multiple clients to schedule operations amongst clients. It worked great on XP. Moving to win7, I can only connect a client to the server on the same machine. At this point, I'm thinking it's something to do with IPv6, but I'm stumped as to how to proceed. Client trying to connect to a remote server gives...

Use UdpClient with IPv4 and IPv6?

A little while ago I created a class to deal with my LAN networking programs. I recently upgraded one of my laptops to windows 7 and relized that windows 7 (or at least the way I have it set up) only supports IPv6, but my desktop is still back in the Windows xp days, and only uses IPv4. The class I created uses the UdpClient class, and...

how to bind a link local address to an ipv6 socket

This thread can be treated as a sister thread of previous one posted by me as well. It's will be very tedious that when you want to bind a link local adress to a ipv6 socket you need to the set sin6_scope_id field of sockaddr_in6 struct as well. I'm wondering if someone can provide a good practise like solution here for me or anyone who ...

Ruby IpV6 Multicast Sending and Receive

Hi, as object i'm tring to create a client and server scripts in order to send and receive multicast packages over IPv6. In IPv4 everything work as well, but i cannot figure out how to change it in IPv6. I start as basis from Multicasting In Ruby but seems ff12::3422 isnt good for MULTICAST_ADDR as others i already try to assign. Than...

Cannot bind to IPv6 address

I am facing a strange problem on my Ubuntu Karmic system. When I call getaddrinfo() with AI_PASSIVE and AF_UNSPEC, for an empty host and the UDP 12000 port to get a bindable address, I only get back one IPv4 result (0.0.0.0:12000 for instance). If I change my call and specify AF_INET6 instead of AF_UNSPEC, then getaddrinfo() returns "N...

gethostbyname replacement for IPv6 addresses

Hi, I have a program that uses gethostbyname (in Windows) in order to convert IP address to hostname. But, it works only for IPv4... What is the correct replacement for IPv6? Thanks. ...

REMOTE_ADDR and IPv6 in PHP

Is it safe to assume that $_SERVER['REMOTE_ADDR'] always returns a IPv4 address? Thanks! ...

Converting IPv4 or IPv6 address to a long for comparisons

In order to check if an IPv4 or IPv6 address is within a certain range, I've got code that takes an IPv4 address, turns that into a long, then does that same conversion on the upper/lower bound of the subnet, then checks to see if the long is between those values. I'd like to be able to do the same thing for IPv6, but saw nothing in the...

PHP Disabling ipv6

Hello, It seems that I need to somehow disable IPv6 on my php pages, but I am not sure how to do this. I think I have to add --disable-ipv6 somewhere into my INI file... this doesnt look like proper syntax though. I am trying to solve the following bug: http://bugs.php.net/45519 Does anyone know where to put this? ...