Blob Blame History Raw
diff -Naur libreswan-3.32-orig/lib/libipsecconf/interfaces.c libreswan-3.32/lib/libipsecconf/interfaces.c
--- libreswan-3.32-orig/lib/libipsecconf/interfaces.c	2020-05-11 10:13:41.000000000 -0400
+++ libreswan-3.32/lib/libipsecconf/interfaces.c	2020-06-04 18:51:39.508280352 -0400
@@ -71,7 +71,11 @@
 		if (sa->sa.sa_family == af) {
 			/* XXX: sizeof right? */
 			ip_endpoint nhe;
-			happy(sockaddr_to_endpoint(sa, sizeof(*sa), &nhe));
+			err_t e = sockaddr_to_endpoint(sa, sizeof(*sa), &nhe);
+			if (e != NULL) {
+			 	pexpect(e != NULL);
+				return false;
+			}
 			pexpect(endpoint_hport(&nhe) == 0);
 			*nh = endpoint_address(&nhe);
 		}
@@ -84,7 +88,11 @@
 		if (sa->sa.sa_family == af) {
 			/* XXX: sizeof right? */
 			ip_endpoint dste;
-			happy(sockaddr_to_endpoint(sa, sizeof(*sa), &dste));
+			err_t e = sockaddr_to_endpoint(sa, sizeof(*sa), &dste);
+			if (e != NULL) {
+			 	pexpect(e != NULL);
+				return false;
+			}
 			pexpect(endpoint_hport(&dste) == 0);
 			*dst = endpoint_address(&dste);
 		}
diff -Naur libreswan-3.32-orig/lib/libswan/ip_endpoint.c libreswan-3.32/lib/libswan/ip_endpoint.c
--- libreswan-3.32-orig/lib/libswan/ip_endpoint.c	2020-05-11 10:13:41.000000000 -0400
+++ libreswan-3.32/lib/libswan/ip_endpoint.c	2020-06-04 18:51:39.508280352 -0400
@@ -54,20 +54,12 @@
 	switch (sa->sa.sa_family) {
 	case AF_INET:
 	{
-		/* XXX: to strict? */
-		if (sa_len != sizeof(sa->sin)) {
-			return "wrong length";
-		}
 		address = address_from_in_addr(&sa->sin.sin_addr);
 		port = ntohs(sa->sin.sin_port);
 		break;
 	}
 	case AF_INET6:
 	{
-		/* XXX: to strict? */
-		if (sa_len != sizeof(sa->sin6)) {
-			return "wrong length";
-		}
 		address = address_from_in6_addr(&sa->sin6.sin6_addr);
 		port = ntohs(sa->sin6.sin6_port);
 		break;