Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
09b561f1
Commit
09b561f1
authored
Aug 19, 2017
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zephyr/modusocket: Update struct sockaddr family field name.
Was changed to "sa_family" for POSIX compatibility.
parent
0aa1d3f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
zephyr/modusocket.c
zephyr/modusocket.c
+3
-3
No files found.
zephyr/modusocket.c
View file @
09b561f1
...
...
@@ -88,8 +88,8 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) {
// We employ the fact that port and address offsets are the same for IPv4 & IPv6
struct
sockaddr_in6
*
sockaddr_in6
=
(
struct
sockaddr_in6
*
)
addr
;
char
buf
[
40
];
net_addr_ntop
(
addr
->
family
,
&
sockaddr_in6
->
sin6_addr
,
buf
,
sizeof
(
buf
));
mp_obj_tuple_t
*
tuple
=
mp_obj_new_tuple
(
addr
->
family
==
AF_INET
?
2
:
4
,
NULL
);
net_addr_ntop
(
addr
->
sa_
family
,
&
sockaddr_in6
->
sin6_addr
,
buf
,
sizeof
(
buf
));
mp_obj_tuple_t
*
tuple
=
mp_obj_new_tuple
(
addr
->
sa_
family
==
AF_INET
?
2
:
4
,
NULL
);
tuple
->
items
[
0
]
=
mp_obj_new_str
(
buf
,
strlen
(
buf
),
false
);
// We employ the fact that port offset is the same for IPv4 & IPv6
...
...
@@ -97,7 +97,7 @@ STATIC mp_obj_t format_inet_addr(struct sockaddr *addr, mp_obj_t port) {
//tuple->items[1] = mp_obj_new_int(ntohs(((struct sockaddr_in*)addr)->sin_port));
tuple
->
items
[
1
]
=
port
;
if
(
addr
->
family
==
AF_INET6
)
{
if
(
addr
->
sa_
family
==
AF_INET6
)
{
tuple
->
items
[
2
]
=
MP_OBJ_NEW_SMALL_INT
(
0
);
// flow_info
tuple
->
items
[
3
]
=
MP_OBJ_NEW_SMALL_INT
(
sockaddr_in6
->
sin6_scope_id
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment