@@ -78,6 +78,31 @@ impl TryFrom<DeviceListResponse> for UsbmuxdDevice {
7878 u16:: from_be_bytes ( [ addr[ 22 ] , addr[ 23 ] ] ) ,
7979 ) ) )
8080 }
81+ 0x1C => {
82+ if addr. len ( ) < 28 {
83+ warn ! ( "IPv6 sockaddr_in6 data too short (len {})" , addr. len( ) ) ;
84+ return Err ( IdeviceError :: UnexpectedResponse ) ;
85+ }
86+ if addr[ 1 ] == 0x1E {
87+ // IPv6 address starts at offset 8 in sockaddr_in6
88+ Connection :: Network ( IpAddr :: V6 ( Ipv6Addr :: new (
89+ u16:: from_be_bytes ( [ addr[ 8 ] , addr[ 9 ] ] ) ,
90+ u16:: from_be_bytes ( [ addr[ 10 ] , addr[ 11 ] ] ) ,
91+ u16:: from_be_bytes ( [ addr[ 12 ] , addr[ 13 ] ] ) ,
92+ u16:: from_be_bytes ( [ addr[ 14 ] , addr[ 15 ] ] ) ,
93+ u16:: from_be_bytes ( [ addr[ 16 ] , addr[ 17 ] ] ) ,
94+ u16:: from_be_bytes ( [ addr[ 18 ] , addr[ 19 ] ] ) ,
95+ u16:: from_be_bytes ( [ addr[ 20 ] , addr[ 21 ] ] ) ,
96+ u16:: from_be_bytes ( [ addr[ 22 ] , addr[ 23 ] ] ) ,
97+ ) ) )
98+ } else {
99+ warn ! (
100+ "Expected IPv6 family (0x1E) but got {:02X} for length 0x1C" ,
101+ addr[ 1 ]
102+ ) ;
103+ Connection :: Unknown ( format ! ( "Network {:02X}" , addr[ 1 ] ) )
104+ }
105+ }
81106 _ => {
82107 warn ! ( "Unknown IP address protocol: {:02X}" , addr[ 0 ] ) ;
83108 Connection :: Unknown ( format ! ( "Network {:02X}" , addr[ 0 ] ) )
0 commit comments