Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9db2f571
Commit
9db2f571
authored
Jul 23, 2001
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instead of accessing ss_family, cast sockaddr_storage to sockaddr and access sa_family.
parent
b5c61a89
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
335 additions
and
335 deletions
+335
-335
Modules/socketmodule.c
Modules/socketmodule.c
+5
-1
configure
configure
+330
-332
configure.in
configure.in
+0
-2
No files found.
Modules/socketmodule.c
View file @
9db2f571
...
...
@@ -1894,6 +1894,7 @@ PySocket_gethostbyname_ex(PyObject *self, PyObject *args)
char
*
name
;
struct
hostent
*
h
;
struct
sockaddr_storage
addr
;
struct
sockaddr
*
sa
;
PyObject
*
ret
;
#ifdef HAVE_GETHOSTBYNAME_R
struct
hostent
hp_allocated
;
...
...
@@ -1931,7 +1932,10 @@ PySocket_gethostbyname_ex(PyObject *self, PyObject *args)
h
=
gethostbyname
(
name
);
#endif
/* HAVE_GETHOSTBYNAME_R */
Py_END_ALLOW_THREADS
ret
=
gethost_common
(
h
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
),
addr
.
ss_family
);
/* Some C libraries would require addr.__ss_family instead of addr.ss_family.
Therefore, we cast the sockaddr_storage into sockaddr to access sa_family. */
sa
=
(
struct
sockaddr
*
)
&
addr
;
ret
=
gethost_common
(
h
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
),
sa
->
sa_family
);
#ifdef USE_GETHOSTBYNAME_LOCK
PyThread_release_lock
(
gethostbyname_lock
);
#endif
...
...
configure
View file @
9db2f571
This diff is collapsed.
Click to expand it.
configure.in
View file @
9db2f571
...
...
@@ -374,8 +374,6 @@ else
fi
# Check for enable-ipv6
# XXX definition of ss_family disabled until author clarifies rationale.
# DEFS="$DEFS -Dss_family=__ss_family -Dss_len=__ss_len"
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 Enable ipv6 (with ipv4) support
...
...
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