summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-07-11 21:27:51 -0700
committerPaul Jakma <paul@quagga.net>2009-07-16 18:13:00 +0100
commit3fa3f957e70f594cc2c1cac03644ddf48554c178 (patch)
tree86e63fd609afab8fc297e557b03cd4993f981ab2
parent9b4ef258a9d9c5f1052afe0e19ebaef9f6740fa2 (diff)
[lib] Fix IPv6 normalisation
* lib/sockunion.c: (sockunion_normalise_mapped) The code to normalize address was not copying port value - probably reason why IPV4 in IPV6 never worked right.
-rw-r--r--lib/sockunion.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 75419b11..6a40f332 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -238,6 +238,7 @@ sockunion_normalise_mapped (union sockunion *su)
{
memset (&sin, 0, sizeof (struct sockaddr_in));
sin.sin_family = AF_INET;
+ sin.sin_port = su->sin6.sin6_port;
memcpy (&sin.sin_addr, ((char *)&su->sin6.sin6_addr) + 12, 4);
memcpy (su, &sin, sizeof (struct sockaddr_in));
}