[9] Review request : JDK-6933879: URISyntaxException when non-alphanumeric characters are present in scope_id

Konstantin Shefov konstantin.shefov at oracle.com
Mon Jan 12 14:37:18 UTC 2015


Hello, Chris

You have asked "Have you seen NetworkInterface.getName() return names 
with ‘_’, ’.’, or ‘:’ ,or is this theoretical?"

I can answer your question. I have named one of network interfaces on my 
Linux desktop like "eth0.1_55".

ifconfig says:
eth0.1_55 Link encap:Ethernet  HWaddr 08:00:27:10:c0:3e
           inet addr:10.162.82.115  Bcast:10.162.83.255 Mask:255.255.254.0
           inet6 addr: 2606:b400:81c:1050:6568:8bee:d39b:68aa/64 
Scope:Global
           inet6 addr: 2606:b400:81c:1044:a00:27ff:fe10:c03e/64 Scope:Global
           inet6 addr: 2606:b400:81c:1050:a00:27ff:fe10:c03e/64 Scope:Global
           inet6 addr: fe80::a00:27ff:fe10:c03e/64 Scope:Link
           inet6 addr: 2606:b400:81c:1044:6568:8bee:d39b:68aa/64 
Scope:Global
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:1198 errors:0 dropped:0 overruns:0 frame:0
           TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:144325 (144.3 KB)  TX bytes:31843 (31.8 KB)

Simple java code

Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
System.out.println(nis.nextElement().getName());

returns exactly "eth0.1_55".

This means we can include dot "." and underscore "_" symbols to URI 
scope id.

-Konstantin

On 11.12.2014 18:29, Chris Hegarty wrote:
> On 11 Dec 2014, at 11:09, Konstantin Shefov <konstantin.shefov at oracle.com> wrote:
>
>> CC'ed core-libs-dev at openjdk.java.net
>>
>> On 10.12.2014 18:21, Konstantin Shefov wrote:
>>> Hello,
>>>
>>> Please, review the bug fix: https://bugs.openjdk.java.net/browse/JDK-6933879
>>> Webrev: http://cr.openjdk.java.net/~kshefov/6933879/webrev.00
>>>
>>> It is suggested to add some more symbols allowed for scope id in IPv6 URI, namely "_", "." and ":", because these symbols may be included in network interface names. Now only alphanumeric characters are allowed to be in a scope id.
>  From Inet6Address, "Textual representation of IPv6 scoped addresses” [1] :
>
>    “…
>     As a string. This must be the exact string that is returned by
>     NetworkInterface.getName() for the particular interface in
>     question. When an Inet6Address is created in this way, the
>     numeric scope-id is determined at the time the object is
>     created by querying the relevant NetworkInterface."
>
> Have you seen NetworkInterface.getName() return names with ‘_’, ’.’, or ‘:’  ,or is this theoretical ?
>
> -Chris.
>
> [1] http://docs.oracle.com/javase/8/docs/api/java/net/Inet6Address.html#scoped
>
>
>>> Thanks
>>> -Konstantin




More information about the core-libs-dev mailing list