RFR: 8302659: Modernize Windows native code for NetworkInterface [v3]
Rich DiCroce
duke at openjdk.org
Thu Feb 23 15:21:11 UTC 2023
On Thu, 23 Feb 2023 14:42:42 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> > I searched for other WinAPIs of interest; [GetIfStackTable](https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-getifstacktable) caught my attention.
> > As far as I could see, the network interfaces are arranged in a stack with many filter interfaces stacked on top of a single non-filter interface. All interfaces in a stack return the same values from `isUp`, `isPointToPoint`, `isLoopback` and `getHardwareAddress`. The filter interfaces do not have any IP addresses, and are not usable with multicast sockets.
> > I'm not sure how we could put that information to use. Ideas welcome.
>
> Is there anything practical a Java Application could do with these interfaces? Except displaying them for debugging purposes? I mean - for instance - would it work if you tried, or are there case where it would be necessary, to set one of these as the outgoing interface of a multicast socket? Otherwise maybe we could just filter the filters out for now...
I'm not sure if there's anything useful a Java application could do with the filter interfaces. I can't think of any. Having said that, the filter interfaces are returned by the existing code, so if we stop returning them, that is a functional change. I'm okay with that if you guys are.
But note that it is not guaranteed that all filters on top of an interface would return the same values for e.g. `isUp()`. The docs for [GetIfTable2Ex](https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-getiftable2ex) provide an example of this:
> An NDIS filter driver (LWF) can be attached on top of the NDIS intermediate driver. Assume that the NIC reports the MediaConnectState member of the MIB_IF_ROW2 structure as MediaConnectStateConnected but NDIS filter driver modifies the state and reports the state as MediaConnectStateDisconnected. When the interface information is queried with Level parameter set to MibIfTableNormal, the state at the top of the filter stack, that is MediaConnectStateDisconnected is reported. When the interface is queried with the Level parameter set to MibIfTableRaw, the state at the interface level directly, that is MediaConnectStateConnected is returned.
-------------
PR: https://git.openjdk.org/jdk/pull/12593
More information about the build-dev
mailing list