Pārlūkot izejas kodu

[slam] Allow for the possibility of IPv6 multicast addresses

Signed-off-by: Michael Brown <mcb30@ipxe.org>
master
Michael Brown 4 gadus atpakaļ
vecāks
revīzija
0a74321915
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4
    4
      src/net/udp/slam.c

+ 4
- 4
src/net/udp/slam.c Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt