diff -u freeradius-server-2.0.4/src/lib/packet.c.orig freeradius-server-2.0.4/src/lib/packet.c
--- freeradius-server-2.0.4/src/lib/packet.c.orig	2008-05-29 11:53:26.000000000 -0400
+++ freeradius-server-2.0.4/src/lib/packet.c	2008-05-29 12:13:41.000000000 -0400
@@ -175,8 +175,14 @@
 int fr_socket(fr_ipaddr_t *ipaddr, int port)
 {
 	int sockfd;
-	struct sockaddr_storage salocal;
 	socklen_t	salen;
+        union {
+            struct sockaddr sa;
+            struct sockaddr_storage ss;
+            struct sockaddr_in in4;
+            struct sockaddr_in6 in6;
+        } sa;
+
 
 	if ((port < 0) || (port > 65535)) {
 		librad_log("Port %d is out of allowed bounds", port);
@@ -198,25 +204,19 @@
 	}
 #endif
 
-	memset(&salocal, 0, sizeof(salocal));
+	memset(&sa, 0, sizeof(sa));
 	if (ipaddr->af == AF_INET) {
-		struct sockaddr_in *sa;
-
-		sa = (struct sockaddr_in *) &salocal;
-		sa->sin_family = AF_INET;
-		sa->sin_addr = ipaddr->ipaddr.ip4addr;
-		sa->sin_port = htons((uint16_t) port);
-		salen = sizeof(*sa);
+		sa.in4.sin_family = AF_INET;
+		sa.in4.sin_addr = ipaddr->ipaddr.ip4addr;
+		sa.in4.sin_port = htons((uint16_t) port);
+		salen = sizeof(sa.in4);
 
 #ifdef HAVE_STRUCT_SOCKADDR_IN6
 	} else if (ipaddr->af == AF_INET6) {
-		struct sockaddr_in6 *sa;
-
-		sa = (struct sockaddr_in6 *) &salocal;
-		sa->sin6_family = AF_INET6;
-		sa->sin6_addr = ipaddr->ipaddr.ip6addr;
-		sa->sin6_port = htons((uint16_t) port);
-		salen = sizeof(*sa);
+		sa.in6.sin6_family = AF_INET6;
+		sa.in6.sin6_addr = ipaddr->ipaddr.ip6addr;
+		sa.in6.sin6_port = htons((uint16_t) port);
+		salen = sizeof(sa.in6);
 
 #if 1
 		/*
@@ -240,7 +240,7 @@
 		return sockfd;	/* don't bind it */
 	}
 
-	if (bind(sockfd, (struct sockaddr *) &salocal, salen) < 0) {
+	if (bind(sockfd, &sa.sa, salen) < 0) {
 		close(sockfd);
 		return -1;
 	}
