Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix: add if_indextoname #1443

Closed
wants to merge 23 commits into from

Conversation

pekkanikander
Copy link
Contributor

@pekkanikander pekkanikander commented Jul 27, 2017

if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but I don't have
Windows compilation environment. Hence, Windows
help would be appreciated.

This is needed by nodejs/node#14500

misery and others added 20 commits July 9, 2017 16:35
Fixes segfault of unit test on musl (AlpineLinux).
Add a check for parameter like uv_os_setenv do.

PR-URL: libuv#1409
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Add a small warning about uv_get_process_title()
and uv_set_process_title() not being thread safe on platforms
other than Windows. Also add a reminder for users to call
uv_setup_args() first.

Fixes: libuv#1395
PR-URL: libuv#1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Ensures that the user's argv is copied into a local buffer when calling
uv_setup_args. Before, the argv was simply being pointed to, which
meant that libuv could end up accessing invalid memory if the user
decided to later edit the memory at that location. It also meant that a
subsequent call to uv_set_process_title would never write more
characters than the length of argv[0].

With the new changes, argv[0] is copied into a temporary buffer and any
subsequent calls to uv_set_process_title will thus be able to copy as
many characters as the call to uv__strdup permits. Note that on *BSD
and AIX this behaviour was already in effect .

Some error checking (specifically checking the result of uv__strdup)
has been added, and calls to uv__free rearranged so that in case of
ENOMEM uv__free can't be called erroneously.

Fixes: libuv#1395
PR-URL: libuv#1396
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Out-of-band TCP messages are used for TCP data
transmission outside (outband) the inbound TCP
data. These packets are sent with an
"urgent pointer", but previously discarded.

Additionally, when using (e)poll a POLLPRI is
triggered when an interrupt signal is received
on GPIO capable systems such as the Raspberry Pi.

PR-URL: libuv#1040
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Refs: appveyor/ci#1649
Refs: libuv#1284
Refs: libuv#1405
PR-URL: libuv#1418
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Should make the dreaded "%1 is not a valid Win32 application" error
message a thing of the past.

PR-URL: libuv#1116
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
uv_interface_addresses API extracts the network interface entries.
In AIX, this was not fully implemented. retrieve the network mask and
the mac addresses.

Fixes: nodejs/node#14119
PR-URL: libuv#1410
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
PR-URL: libuv#1424
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
fix a wrong `if` in `uv_interface_address` about MAC.

Fixes: nodejs/node#13581
PR-URL: libuv#1375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Introduced in
libuv@2f6d4b4 and accidentally undone in
libuv@19c896d.

PR-URL: libuv#1415
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
PR-URL: libuv#1431
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
PR-URL: libuv#1432
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: libuv#1432
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Source code examples in the User guide were not appearing in the built
documentation because the relative paths were incorrect.

PR-URL: libuv#1428
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Fixes compiling with Android NDK when using Unified Headers (default
since r15).

Fixes: libuv#1417
PR-URL: libuv#1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: libuv#1433
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Allow for running uv_fs_stat and uv_fs_lstat on all reparse points

Ref: nodejs/node#12737
PR-URL: libuv#1419
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
It's only available on API level >= 21.

PR-URL: libuv#1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The latest NDK (r15 at the time of this writing) no longer needs this.
`pthread_cond_timedwait` is available at any (reasonable) API level.

PR-URL: libuv#1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: libuv#1441
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
pekkanikander added a commit to Ell-i/libuv that referenced this pull request Jul 27, 2017
if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but
that has not been tested.

PR-UR: libuv#1443
pekkanikander added a commit to Ell-i/libuv that referenced this pull request Jul 27, 2017
if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but
that has not been tested.

PR-URL: libuv#1443
pekkanikander added a commit to Ell-i/libuv that referenced this pull request Jul 27, 2017
if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but
that has not been tested.

Adds documentation.

PR-URL: libuv#1443
@saghul
Copy link
Member

saghul commented Jul 27, 2017

Can you provide some justification as to why you'd like to see this in libuv?

@pekkanikander
Copy link
Contributor Author

As I indicated above, it is needed so that my improvement to NodeJS would be accepted.
See nodejs/node#14500

Fixes a bug that would cause libuv to crash when PATH environment
variable contained paths with semicolon in it

Refs: nodejs/help#728
Fixes: libuv#1422
PR-URL: libuv#1438
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@saghul
Copy link
Member

saghul commented Jul 27, 2017

Ah, I see, sorry. We need a Windows implementation in order to proceed though. And at least a test.

@pekkanikander
Copy link
Contributor Author

@saghul The implementation may or may not work on Windows. Unfortunately I have no possibility to test. If it does not run, the probable reason is that in Windows you need to include some header file that is currently not included. Windows does have the same underlying API.

I will add a test case later today. But it will take some time since I will need to learn how to write test cases for uv.

pekkanikander added a commit to Ell-i/libuv that referenced this pull request Jul 27, 2017
if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but
that has not been tested.

Adds documentation and an ASSERT to the relevant test case.

PR-URL: libuv#1443
@pekkanikander
Copy link
Contributor Author

@saghul I added an ASSERT to the relevant test case. I tested it on Mac OS X, which is the only platform that I have. It should run also on Windows.

If you can trigger your CI on this PR, I presume it will tell if the addition compiles and works on all platforms or not.

Fixes: libuv#576
PR-URL: libuv#1435
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
@santigimeno
Copy link
Member

@pekkanikander I would target the PR to the v1.x branch which is the current active branch.

if_indextoname(...) is a function defined in <net/if.h>

It is used to convert an IPv6 scope_id into an interface
identifier string such as %eth0 or %lo

There is an identical function in Windows, but
that has not been tested.

Adds documentation and an ASSERT to the relevant test case.

PR-URL: libuv#1443
@pekkanikander
Copy link
Contributor Author

I don't know how to retarget an open PR, so I am closing this one and opening a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet