FileMaker Pro 10 - now with IPv6
Hey all, Just a bit of data for you network guys and application hosting guys out there... Filemaker Pro 10 which has just been released is saying that it "Complies with Internet Protocol Version 6 standards." http://www.filemaker.com/products/fmp/all_features.html Good to see mainstream applications adopting and promoting it. -- Skeeve Stevens, CEO/Technical Director eintellego Pty Ltd - The Networking Specialists skeeve(a)eintellego.net / www.eintellego.net Phone: 1300 753 383, Fax: (+612) 8572 9954 Cell +61 (0)414 753 383 / skype://skeeve -- NOC, NOC, who's there? Disclaimer: Limits of Liability and Disclaimer: This message is for the named person's use only. It may contain sensitive and private proprietary or legally privileged information. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. eintellego Pty Ltd and each legal entity in the Tefilah Pty Ltd group of companies reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of any such entity. Any reference to costs, fee quotations, contractual transactions and variations to contract terms is subject to separate confirmation in writing signed by an authorised representative of eintellego. Whilst all efforts are made to safeguard inbound and outbound e-mails, we cannot guarantee that attachments are virus-free or compatible with your systems and do not accept any liability in respect of viruses or computer problems experienced.
But wasn't there a big discussion at NZNOG about how applications shouldn't
know anything (or care) about the underlying communication protocols being
used ?
On Thu, Feb 12, 2009 at 2:09 PM, Skeeve Stevens
Hey all,
Just a bit of data for you network guys and application hosting guys out there... Filemaker Pro 10 which has just been released is saying that it "Complies with Internet Protocol Version 6 standards."
*http://www.filemaker.com/products/fmp/all_features.html*http://www.filemaker.com/products/fmp/all_features.html
Good to see mainstream applications adopting and promoting it.
Heh.
I asked the question partially in jest, but also to highlight and get some
discussion going on the differences between what's out there and of course
what /should/ be out there. It's so easy to make code ipv4 specific without
necessarily realising it. How many people have used gethostbyname in their
code, for example ?
And agreed, it's a good start to see companies thinking about this sort of
thing.
On Thu, Feb 12, 2009 at 2:52 PM, Dean Pemberton
Not entirely.
They SHOULD be agnostic, but programmers have been assuming that IP == IPv4 for so long that anything can happen when you try and put in addresses with :s in them. As Skeeve points out, it's great to see that people are thinking about this and adding "IPv6 compliance" to regression tests.
Dean
On 12/02/2009, at 2:45 PM, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
That'd be nice in theory, however too many applications still expect a particular address family. They will only resolve A records, store an IP address in a 15 character field, or throw around v4 addresses on the wire. Here's a document that started in 1998 about making Unix apps neutral when it comes to the AF. Over 10 years later and apps still make the same mistakes. http://www.kame.net/newsletter/19980604/ Sam.
Also, for example, the new Filemaker Pro 10 supports direct sending of email via SMTP servers. When you enter the IP address/domain name of the SMTP server, just like in XP in which the fields are separated, perhaps they want to support the correct storing/validation of what is entered. Unless we're expecting all applications to just have an unverified freeform field. -- Skeeve Stevens, CEO/Technical Director eintellego Pty Ltd - The Networking Specialists skeeve(a)eintellego.net / www.eintellego.net Phone: 1300 753 383, Fax: (+612) 8572 9954 Cell +61 (0)414 753 383 / skype://skeeve -- NOC, NOC, who's there? Disclaimer: Limits of Liability and Disclaimer: This message is for the named person's use only. It may contain sensitive and private proprietary or legally privileged information. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. eintellego Pty Ltd and each legal entity in the Tefilah Pty Ltd group of companies reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of any such entity. Any reference to costs, fee quotations, contractual transactions and variations to contract terms is subject to separate confirmation in writing signed by an authorised representative of eintellego. Whilst all efforts are made to safeguard inbound and outbound e-mails, we cannot guarantee that attachments are virus-free or compatible with your systems and do not accept any liability in respect of viruses or computer problems experienced.
-----Original Message----- From: Sam Sargeant [mailto:sam.sargeant(a)gmail.com] Sent: Thursday, 12 February 2009 12:56 PM To: Ian Batterbee Cc: NZNOG(a)list.waikato.ac.nz Subject: Re: [nznog] FileMaker Pro 10 - now with IPv6
On 12/02/2009, at 2:45 PM, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
That'd be nice in theory, however too many applications still expect a particular address family. They will only resolve A records, store an IP address in a 15 character field, or throw around v4 addresses on the wire.
Here's a document that started in 1998 about making Unix apps neutral when it comes to the AF. Over 10 years later and apps still make the same mistakes.
http://www.kame.net/newsletter/19980604/
Sam.
_______________________________________________ NZNOG mailing list NZNOG(a)list.waikato.ac.nz http://list.waikato.ac.nz/mailman/listinfo/nznog
On Thu, 2009-02-12 at 14:45 +1300, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
Yes, and wouldn't it be nice if *libc* didn't want applications to make different calls when using IPv6 addresses vs. IPv4 addresses? So while that's a great theory it first needs people to write libraries that deal with these addresses without having to consider what form they are. One common approach seems to be to switch the application to handle all addresses as IPv6 addresses, mapping IPv4 addresses into their 6-to-4 equivalents. Of course you may still have to maintain an additional bit of information as to whether this is *really* IPv4 or IPv6, but hopefully that can be inside the library rather than outside it, and given the nature of 6-to-4 it can even be stored within the mapped address itself. I believe this is the best approach. Subtleties of behaviour also have effects. An example of one that bit me, is that the Undernet IRC server considers 1 IPv4 address equivalent to 1 IPv6 /64 for rate limiting purposes. While this kind of heuristic works OK with the same values for private and public servers both on NATed LANs and the intartubes for IPv4, for IPv6 everyone on your LAN connecting to your private IRC server will have an IPv6 in the same /64 and rate limiting will kick in unless you completely change the rate limiting values. So that is an example of an application which *needs* to know the type of address in order to be able to make the correct decision. Regards, Andrew McMillan. ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN You can rent this space for only $5 a week. ------------------------------------------------------------------------
Subtleties of behaviour also have effects. An example of one that bit me, is that the Undernet IRC server considers 1 IPv4 address equivalent to 1 IPv6 /64 for rate limiting purposes. While this kind of heuristic works OK with the same values for private and public servers both on NATed LANs and the intartubes for IPv4, for IPv6 everyone on your LAN connecting to your private IRC server will have an IPv6 in the same /64 and rate limiting will kick in unless you completely change the rate limiting values. So that is an example of an application which *needs* to know the type of address in order to be able to make the correct decision.
Speaking as the person who actually designed that system for Undernet, that behavior was intentional. :) ircu knows about 6to4 addresses and teredo addresses, and will rate limit them based on the IPv4 address contained within them to prevent people using 6to4 to avoid rate limits or glines/bans. Also, since changing your "autoconf"'d address is near enough trivail, people using them for ban evasion, and flooding is a major concern, so there is the intentional per /64 rate limit. ircu is primarily designed for use on Undernet, which is quite literally constantly being attacked, both intentionally, and by misbehaving/misconfigured clients. Without strong safeguards in place, the servers melt. (actually, even /with/ strong safeguards in place, the servers often melt anyway) ircu internally knows the difference between v4 and v6. The major reason Undernet hasn't been upgraded to v6 is that our services haven't been updated to deal with v6 addresses being announced by the network[1]. While I understand this is annoying for private installations of ircu, there are tunable options that you can tinker with. [1]: If anyone's bored, I'm happy to give you the code and help you through writing the code to update it for v6, I'll update Undernet to run the new code, and we can finally turn on v6 network wide. I warn you this is perhaps not as simple as it sounds at first glance to get it to the point we can turn it on network wide.
On Fri, 2009-02-13 at 12:04 +1300, Perry Lorier wrote:
Subtleties of behaviour also have effects. An example of one that bit me, is that the Undernet IRC server considers 1 IPv4 address equivalent to 1 IPv6 /64 for rate limiting purposes. While this kind of heuristic works OK with the same values for private and public servers both on NATed LANs and the intartubes for IPv4, for IPv6 everyone on your LAN connecting to your private IRC server will have an IPv6 in the same /64 and rate limiting will kick in unless you completely change the rate limiting values. So that is an example of an application which *needs* to know the type of address in order to be able to make the correct decision.
Speaking as the person who actually designed that system for Undernet, that behavior was intentional. :)
Sure, which shows how the heuristics used for IPv4 *could* *not* be directly mapped to equally apt heuristics for IPv6, doesn't it? Our server worked fine for years without tuning, right up until the first restart after we added an AAAA record for it. My point is that while it might be a laudable goal to have software that is IPv6/IPv4 agnostic there are still going to be plenty of gotchas out there waiting for people, because the network will behave differently - outside of the fact that the actual addresses happen to be different data types. Many pieces of software, not just IRC servers, imply meaning into a single IPv4 ip address, or a /24, and it is quite likely that those meanings won't have easy equivalents in an IPv6 addressable. Cheers, Andrew. ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN Though a superhero, Bruce Schneier disdains the use of a mask or secret identity as 'security through obscurity'. ------------------------------------------------------------------------
Andrew McMillan wrote:
On Fri, 2009-02-13 at 12:04 +1300, Perry Lorier wrote:
Subtleties of behaviour also have effects. An example of one that bit me, is that the Undernet IRC server considers 1 IPv4 address equivalent to 1 IPv6 /64 for rate limiting purposes. While this kind of heuristic works OK with the same values for private and public servers both on NATed LANs and the intartubes for IPv4, for IPv6 everyone on your LAN connecting to your private IRC server will have an IPv6 in the same /64 and rate limiting will kick in unless you completely change the rate limiting values. So that is an example of an application which *needs* to know the type of address in order to be able to make the correct decision.
Speaking as the person who actually designed that system for Undernet, that behavior was intentional. :)
Sure, which shows how the heuristics used for IPv4 *could* *not* be directly mapped to equally apt heuristics for IPv6, doesn't it? Our server worked fine for years without tuning, right up until the first restart after we added an AAAA record for it.
I like to think that we considered the various new attack vectors that IPv6 made available (including the ability for people to programatically generate millions of addresses that they couldn't easily do before), talked to other networks (such as efnet and freenode) that were running v6 in production about what abuse they were seeing, and what their thoughts were, and then came up with something that attempted to mitigated as many of the attacks as we could. You'll note that ircu doesn't have any idea about the structure of IPv4 addresses (such as /24's), that function is taken up by global services which know more about who has what IP ranges allocated to them, and so on. This is fresh code for IPv6 that was never part of our IPv4 support. Yes, it's annoying for people using ircu standalone out of the box. ircu by default is designed to meet undernet's requirements, which is basically deal with a deluge of 24/7 attacks. :/
My point is that while it might be a laudable goal to have software that is IPv6/IPv4 agnostic there are still going to be plenty of gotchas out there waiting for people, because the network will behave differently - outside of the fact that the actual addresses happen to be different data types. Many pieces of software, not just IRC servers, imply meaning into a single IPv4 ip address, or a /24, and it is quite likely that those meanings won't have easy equivalents in an IPv6 addressable.
Yeah, v6 is a different protocol, and there are reasons (and some of them might even be good reasons in some situations) for people to treat them differently.
On 12 Feb 2009, at 15:45, Andrew McMillan wrote:
On Thu, 2009-02-12 at 14:45 +1300, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
Yes, and wouldn't it be nice if *libc* didn't want applications to make different calls when using IPv6 addresses vs. IPv4 addresses?
Surely the bits of libc that are address-family dependent are those that remain entrenched for historical reasons and rely upon data structures that carry endpoint addresses in 32-bit words. That being the case, requiring the use of different APIs seems fairly understandable. It'd be glorious if there was a non-lossy mapping from 128-bit addresses into 32-bit holes in data structures, but if we could do then we could also encode infinite amounts of data into a single bit and travel backwards in time, so perhaps the libc optimisation would not seem so exciting, in context. Joe
On 15/02/2009, at 4:33 PM, Joe Abley wrote:
It'd be glorious if there was a non-lossy mapping from 128-bit addresses into 32-bit holes in data structures, but if we could do then we could also encode infinite amounts of data into a single bit and travel backwards in time, so perhaps the libc optimisation would not seem so exciting, in context.
I think this is the funniest stream of consciousness post that I've ever seen. -- Nathan Ward
On Thu, 2009-02-12 at 14:45 +1300, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
Yes, and wouldn't it be nice if *libc* didn't want applications to make different calls when using IPv6 addresses vs. IPv4 addresses?
Surely the bits of libc that are address-family dependent are those that remain entrenched for historical reasons and rely upon data structures that carry endpoint addresses in 32-bit words. That being the case, requiring the use of different APIs seems fairly understandable.
the BSD sockets layer was designed, from the outset to support multiple address family's (AF's). There is a structure called "struct sockaddr" which represents a "generic" address of some unknown type. It contains a "sa_family" member which tells you what type of address it is (AF_INET meaning IPv4 address, AF_UNIX meaning unix domain socket, and so on). You then cast it to the correct type (struct sockaddr_in for AF_INET, or struct sockaddr_un for AF_UNIX) to get the correct structure for the correct address family. All system calls (bind,connect,accept and so on) take a (struct sockaddr *), and thus can work with any address family. However some of the libc functions didn't consider things in a way that makes IPv6 useful. gethostbyname(3) for instance can return a list of addresses, but they all have to be the same address type (thus you can't get AF_INET and AF_INET6 addresses at the same time), even more annoyingly the programmer doesn't get to ask if they get AF_INET or AF_INET6 sockets back, the call just returns one or the other (ie, only returns AF_INET addresses). This apears to have been "fixed" at some point by 'getipnodebyname' calls which let you specify that you want AF_INET or AF_INET6 (or any other address family) addresses. Not that this really solves the problem. Thus these were all superseeded with getnameinfo(), that given a name can return a list of addresses, in a specific order, of varying address families. So old apps use gethostbyname(), which is a nice trivial interface, that doesn't do what you want. New apps use getnameinfo() which is a useful interface that does what you want, but is slightly more annoying to use (you have to provide a lot more information to it saying what you want), so it involves a lot more typing. Nobody ever uses getipnodebyname(). Things get even more annoying, when you consider (struct sockaddr) was supposed to be big enough to hold any address type. But it's not quite big enough to fit an IPv6 address and all the ancillary information (port number, scopeid and so on), so now there's "struct sockaddr_storage". So if you're allocating space for a generic address you use "sockaddr_storage", if you want to talk about a generic address of unknown type, you use "sockaddr", and if you want ipv4, ipv6 or unix domain sockets, you use sockaddr_in, sockaddr_in6, or sockaddr_un respectively. Then we get into the messy condition of converting addresses to a printable form (not resolving them, just displaying them). The original interface to convert a sockaddr_in to a printable address was to use inet_ntoa(). This does have the problem that it only works on an IPv4 address (sockaddr_in's generally contain an IP address and a port number), and doesn't work with IPv6 addresses at all. Then theres inet_ntop() which can convert an IPv4 or IPv6 address, but you have to figure out if you're talking about IPv4 or IPv6 addresses before you call it, which again, makes it mostly useless and annoying to use. The "modern" way is to use getaddrinfo(), and pass in the AI_PNUMERICHOST flag which then avoids trying to resolve it. If your application specifically wants to talk about just IPv4 addresses it can in theory use "struct in_addr", and struct in6_addr" for IPv6 addresses. Don't do this. :P Converting an application to IPv6 is generally fairly straight forward. Convert the code that called gethostbyname() to getnameinfo(), convert anything that used inet_*to*() to use getnameinfo()/getaddrinfo() with AI_NUMERICHOST. Convert anything that's listen()ing on sockets to also listen on a v6 socket. Things get hairier when you want to step through a list of addresses returned by getnameinfo(). Make sure that some of the "sockaddr"'s become "sockaddr_storages" (But only the ones that allocate space, not ones that refer to a generic address that's allocated elsewhere). And then you have to deal with internal address policies. Where they are displayed, are they stored, or transfered over the network? Are they hashed? are there matches or other bits of code that know about the structure of an IP address being used? Does it use : at the end of an address to represent a port number? Do the internal protocol(s) use : for anything special? This is often where porting an application becomes really difficult.
What an excellent summary! -----Original Message----- From: Perry Lorier [mailto:perry(a)coders.net] Sent: Monday, 16 February 2009 10:58 a.m. To: Joe Abley Cc: NZNOG(a)list.waikato.ac.nz Subject: Re: [nznog] FileMaker Pro 10 - now with IPv6
On Thu, 2009-02-12 at 14:45 +1300, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
Yes, and wouldn't it be nice if *libc* didn't want applications to make different calls when using IPv6 addresses vs. IPv4 addresses?
Surely the bits of libc that are address-family dependent are those that remain entrenched for historical reasons and rely upon data structures that carry endpoint addresses in 32-bit words. That being the case, requiring the use of different APIs seems fairly understandable.
the BSD sockets layer was designed, from the outset to support multiple address family's (AF's). There is a structure called "struct sockaddr" which represents a "generic" address of some unknown type. It contains a "sa_family" member which tells you what type of address it is (AF_INET meaning IPv4 address, AF_UNIX meaning unix domain socket, and so on). You then cast it to the correct type (struct sockaddr_in for AF_INET, or struct sockaddr_un for AF_UNIX) to get the correct structure for the correct address family. All system calls (bind,connect,accept and so on) take a (struct sockaddr *), and thus can work with any address family. However some of the libc functions didn't consider things in a way that makes IPv6 useful. gethostbyname(3) for instance can return a list of addresses, but they all have to be the same address type (thus you can't get AF_INET and AF_INET6 addresses at the same time), even more annoyingly the programmer doesn't get to ask if they get AF_INET or AF_INET6 sockets back, the call just returns one or the other (ie, only returns AF_INET addresses). This apears to have been "fixed" at some point by 'getipnodebyname' calls which let you specify that you want AF_INET or AF_INET6 (or any other address family) addresses. Not that this really solves the problem. Thus these were all superseeded with getnameinfo(), that given a name can return a list of addresses, in a specific order, of varying address families. So old apps use gethostbyname(), which is a nice trivial interface, that doesn't do what you want. New apps use getnameinfo() which is a useful interface that does what you want, but is slightly more annoying to use (you have to provide a lot more information to it saying what you want), so it involves a lot more typing. Nobody ever uses getipnodebyname(). Things get even more annoying, when you consider (struct sockaddr) was supposed to be big enough to hold any address type. But it's not quite big enough to fit an IPv6 address and all the ancillary information (port number, scopeid and so on), so now there's "struct sockaddr_storage". So if you're allocating space for a generic address you use "sockaddr_storage", if you want to talk about a generic address of unknown type, you use "sockaddr", and if you want ipv4, ipv6 or unix domain sockets, you use sockaddr_in, sockaddr_in6, or sockaddr_un respectively. Then we get into the messy condition of converting addresses to a printable form (not resolving them, just displaying them). The original interface to convert a sockaddr_in to a printable address was to use inet_ntoa(). This does have the problem that it only works on an IPv4 address (sockaddr_in's generally contain an IP address and a port number), and doesn't work with IPv6 addresses at all. Then theres inet_ntop() which can convert an IPv4 or IPv6 address, but you have to figure out if you're talking about IPv4 or IPv6 addresses before you call it, which again, makes it mostly useless and annoying to use. The "modern" way is to use getaddrinfo(), and pass in the AI_PNUMERICHOST flag which then avoids trying to resolve it. If your application specifically wants to talk about just IPv4 addresses it can in theory use "struct in_addr", and struct in6_addr" for IPv6 addresses. Don't do this. :P Converting an application to IPv6 is generally fairly straight forward. Convert the code that called gethostbyname() to getnameinfo(), convert anything that used inet_*to*() to use getnameinfo()/getaddrinfo() with AI_NUMERICHOST. Convert anything that's listen()ing on sockets to also listen on a v6 socket. Things get hairier when you want to step through a list of addresses returned by getnameinfo(). Make sure that some of the "sockaddr"'s become "sockaddr_storages" (But only the ones that allocate space, not ones that refer to a generic address that's allocated elsewhere). And then you have to deal with internal address policies. Where they are displayed, are they stored, or transfered over the network? Are they hashed? are there matches or other bits of code that know about the structure of an IP address being used? Does it use : at the end of an address to represent a port number? Do the internal protocol(s) use : for anything special? This is often where porting an application becomes really difficult. _______________________________________________ NZNOG mailing list NZNOG(a)list.waikato.ac.nz http://list.waikato.ac.nz/mailman/listinfo/nznog
I don't think I could've found as much insight into the sockets library in a week of searching the intertubes as there is contained in that there email. Bravo! ________________________________ From: Perry Lorier [mailto:perry(a)coders.net] Sent: Mon 16/02/2009 10:58 a.m. To: Joe Abley Cc: NZNOG(a)list.waikato.ac.nz Subject: Re: [nznog] FileMaker Pro 10 - now with IPv6
On Thu, 2009-02-12 at 14:45 +1300, Ian Batterbee wrote:
But wasn't there a big discussion at NZNOG about how applications shouldn't know anything (or care) about the underlying communication protocols being used ?
Yes, and wouldn't it be nice if *libc* didn't want applications to make different calls when using IPv6 addresses vs. IPv4 addresses?
Surely the bits of libc that are address-family dependent are those that remain entrenched for historical reasons and rely upon data structures that carry endpoint addresses in 32-bit words. That being the case, requiring the use of different APIs seems fairly understandable.
the BSD sockets layer was designed, from the outset to support multiple address family's (AF's). There is a structure called "struct sockaddr" which represents a "generic" address of some unknown type. It contains a "sa_family" member which tells you what type of address it is (AF_INET meaning IPv4 address, AF_UNIX meaning unix domain socket, and so on). You then cast it to the correct type (struct sockaddr_in for AF_INET, or struct sockaddr_un for AF_UNIX) to get the correct structure for the correct address family. All system calls (bind,connect,accept and so on) take a (struct sockaddr *), and thus can work with any address family. However some of the libc functions didn't consider things in a way that makes IPv6 useful. gethostbyname(3) for instance can return a list of addresses, but they all have to be the same address type (thus you can't get AF_INET and AF_INET6 addresses at the same time), even more annoyingly the programmer doesn't get to ask if they get AF_INET or AF_INET6 sockets back, the call just returns one or the other (ie, only returns AF_INET addresses). This apears to have been "fixed" at some point by 'getipnodebyname' calls which let you specify that you want AF_INET or AF_INET6 (or any other address family) addresses. Not that this really solves the problem. Thus these were all superseeded with getnameinfo(), that given a name can return a list of addresses, in a specific order, of varying address families. So old apps use gethostbyname(), which is a nice trivial interface, that doesn't do what you want. New apps use getnameinfo() which is a useful interface that does what you want, but is slightly more annoying to use (you have to provide a lot more information to it saying what you want), so it involves a lot more typing. Nobody ever uses getipnodebyname(). Things get even more annoying, when you consider (struct sockaddr) was supposed to be big enough to hold any address type. But it's not quite big enough to fit an IPv6 address and all the ancillary information (port number, scopeid and so on), so now there's "struct sockaddr_storage". So if you're allocating space for a generic address you use "sockaddr_storage", if you want to talk about a generic address of unknown type, you use "sockaddr", and if you want ipv4, ipv6 or unix domain sockets, you use sockaddr_in, sockaddr_in6, or sockaddr_un respectively. Then we get into the messy condition of converting addresses to a printable form (not resolving them, just displaying them). The original interface to convert a sockaddr_in to a printable address was to use inet_ntoa(). This does have the problem that it only works on an IPv4 address (sockaddr_in's generally contain an IP address and a port number), and doesn't work with IPv6 addresses at all. Then theres inet_ntop() which can convert an IPv4 or IPv6 address, but you have to figure out if you're talking about IPv4 or IPv6 addresses before you call it, which again, makes it mostly useless and annoying to use. The "modern" way is to use getaddrinfo(), and pass in the AI_PNUMERICHOST flag which then avoids trying to resolve it. If your application specifically wants to talk about just IPv4 addresses it can in theory use "struct in_addr", and struct in6_addr" for IPv6 addresses. Don't do this. :P Converting an application to IPv6 is generally fairly straight forward. Convert the code that called gethostbyname() to getnameinfo(), convert anything that used inet_*to*() to use getnameinfo()/getaddrinfo() with AI_NUMERICHOST. Convert anything that's listen()ing on sockets to also listen on a v6 socket. Things get hairier when you want to step through a list of addresses returned by getnameinfo(). Make sure that some of the "sockaddr"'s become "sockaddr_storages" (But only the ones that allocate space, not ones that refer to a generic address that's allocated elsewhere). And then you have to deal with internal address policies. Where they are displayed, are they stored, or transfered over the network? Are they hashed? are there matches or other bits of code that know about the structure of an IP address being used? Does it use : at the end of an address to represent a port number? Do the internal protocol(s) use : for anything special? This is often where porting an application becomes really difficult. _______________________________________________ NZNOG mailing list NZNOG(a)list.waikato.ac.nz http://list.waikato.ac.nz/mailman/listinfo/nznog
participants (10)
-
Andrew McMillan
-
Arya Reais-Parsi
-
Dean Pemberton
-
Ian Batterbee
-
Joe Abley
-
Nathan Ward
-
Perry Lorier
-
Philip D'Ath
-
Sam Sargeant
-
Skeeve Stevens