File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -88,16 +88,16 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) {
88
88
// We employ the fact that port and address offsets are the same for IPv4 & IPv6
89
89
struct sockaddr_in6 * sockaddr_in6 = (struct sockaddr_in6 * )addr ;
90
90
char buf [40 ];
91
- net_addr_ntop (addr -> family , & sockaddr_in6 -> sin6_addr , buf , sizeof (buf ));
92
- mp_obj_tuple_t * tuple = mp_obj_new_tuple (addr -> family == AF_INET ? 2 : 4 , NULL );
91
+ net_addr_ntop (addr -> sa_family , & sockaddr_in6 -> sin6_addr , buf , sizeof (buf ));
92
+ mp_obj_tuple_t * tuple = mp_obj_new_tuple (addr -> sa_family == AF_INET ? 2 : 4 , NULL );
93
93
94
94
tuple -> items [0 ] = mp_obj_new_str (buf , strlen (buf ), false);
95
95
// We employ the fact that port offset is the same for IPv4 & IPv6
96
96
// not filled in
97
97
//tuple->items[1] = mp_obj_new_int(ntohs(((struct sockaddr_in*)addr)->sin_port));
98
98
tuple -> items [1 ] = port ;
99
99
100
- if (addr -> family == AF_INET6 ) {
100
+ if (addr -> sa_family == AF_INET6 ) {
101
101
tuple -> items [2 ] = MP_OBJ_NEW_SMALL_INT (0 ); // flow_info
102
102
tuple -> items [3 ] = MP_OBJ_NEW_SMALL_INT (sockaddr_in6 -> sin6_scope_id );
103
103
}
You can’t perform that action at this time.
0 commit comments