Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

os.networkInterfaces() treats interface names as Latin-1 #8633

Closed
agnat opened this issue Oct 27, 2014 · 11 comments
Closed

os.networkInterfaces() treats interface names as Latin-1 #8633

agnat opened this issue Oct 27, 2014 · 11 comments

Comments

@agnat
Copy link

agnat commented Oct 27, 2014

We're looking at a bug over at agnat/node_mdns#100 regarding accents in network interface names. I think this line accidentally treats strings as Latin-1 while libuv takes great care to provide UTF8.

The change was made in f674b09. Could you guys take a look?

@agnat
Copy link
Author

agnat commented Oct 29, 2014

This is a windows issue where interface names are actually unicode.

@agnat
Copy link
Author

agnat commented Nov 2, 2014

@bnoordhuis, sorry to bother you but could you take a minute and take a look at this?

@bnoordhuis
Copy link
Member

Addressed in https://github.com/node-forward/node/pull/44

I wonder though if libuv should really be using AdapterName instead of FriendlyName. @piscisaureus?

@ronkorving
Copy link

Thanks Ben. I believe that repo is currently private, and we can't actually access that PR?

@bnoordhuis
Copy link
Member

It's private because of, well, long story, but it's going public again soon. If you want access, ping me; you can find me in #node-forward on freenode.net.

@piscisaureus
Copy link

I wonder though if libuv should really be using AdapterName instead of FriendlyName. @piscisaureus?

I don't really care. Does anyone?
To see the difference: http://screencast.com/t/mkeJVkXUDeDc

  • The 'name' column is what we report currently
  • The 'device name' column corresponds to the AdapterName field, which @bnoordhuis suggests we use.

@agnat
Copy link
Author

agnat commented Nov 5, 2014

Uhm, I care.

I have code that actually deals with these names. I use these names because it is the node way to refer to interfaces. Others might use these names to refer to interfaces. Think config files.

So, I kindly ask you not to change these names without providing a feasible migration path.

@agnat
Copy link
Author

agnat commented Nov 5, 2014

Sorry for being so tetchy about this. But it kind of hurts to see how easy you guys talk about breaking down stream code.

@agnat
Copy link
Author

agnat commented Nov 5, 2014

If you really want to change the names here are two options that would mitigate the consequences on my end:

  • Use a name that is valid input to the windows version of if_nametoindex. Not sure if that is the AdapterName, though. It would be more symmetric that way.
  • Or, add the interface index as a property to the objects returned by os.networkInterfaces().

@agnat
Copy link
Author

agnat commented Nov 5, 2014

Actually, it would be quite funny if the result of me taking the time to track down this bug would be you breaking my code ... again.

@bnoordhuis
Copy link
Member

@agnat Just the "don't change it because $REASON" comment would have done. We'll leave it as it is.

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

No branches or pull requests

4 participants