Browse Source

[slam] Allow for the possibility of IPv6 multicast addresses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
master
Michael Brown 4 years ago
parent
commit
0a74321915
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      src/net/udp/slam.c

+ 4
- 4
src/net/udp/slam.c View File

655
  */
655
  */
656
 static int slam_parse_multicast_address ( struct slam_request *slam,
656
 static int slam_parse_multicast_address ( struct slam_request *slam,
657
 					  const char *path,
657
 					  const char *path,
658
-					  struct sockaddr_in *address ) {
658
+					  struct sockaddr_tcpip *address ) {
659
 	char *path_dup;
659
 	char *path_dup;
660
 	char *sep;
660
 	char *sep;
661
 	char *end;
661
 	char *end;
673
 	sep = strchr ( path_dup, ':' );
673
 	sep = strchr ( path_dup, ':' );
674
 	if ( sep ) {
674
 	if ( sep ) {
675
 		*(sep++) = '\0';
675
 		*(sep++) = '\0';
676
-		address->sin_port = htons ( strtoul ( sep, &end, 0 ) );
676
+		address->st_port = htons ( strtoul ( sep, &end, 0 ) );
677
 		if ( *end != '\0' ) {
677
 		if ( *end != '\0' ) {
678
 			DBGC ( slam, "SLAM %p invalid multicast port "
678
 			DBGC ( slam, "SLAM %p invalid multicast port "
679
 			       "\"%s\"\n", slam, sep );
679
 			       "\"%s\"\n", slam, sep );
683
 	}
683
 	}
684
 
684
 
685
 	/* Parse address */
685
 	/* Parse address */
686
-	if ( inet_aton ( path_dup, &address->sin_addr ) == 0 ) {
686
+	if ( sock_aton ( path_dup, ( ( struct sockaddr * ) address ) ) == 0 ) {
687
 		DBGC ( slam, "SLAM %p invalid multicast address \"%s\"\n",
687
 		DBGC ( slam, "SLAM %p invalid multicast address \"%s\"\n",
688
 		       slam, path_dup );
688
 		       slam, path_dup );
689
 		rc = -EINVAL;
689
 		rc = -EINVAL;
715
 	};
715
 	};
716
 	struct slam_request *slam;
716
 	struct slam_request *slam;
717
 	struct sockaddr_tcpip server;
717
 	struct sockaddr_tcpip server;
718
-	struct sockaddr_in multicast;
718
+	struct sockaddr_tcpip multicast;
719
 	int rc;
719
 	int rc;
720
 
720
 
721
 	/* Sanity checks */
721
 	/* Sanity checks */

Loading…
Cancel
Save