[
https://issues.apache.org/jira/browse/NIFI-5445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16559715#comment-16559715
]
ASF GitHub Bot commented on NIFI-5445:
--------------------------------------
Github user markap14 commented on the issue:
https://github.com/apache/nifi/pull/2909
@nicholasmhughes This isn't really something that we can do right now, as
it would be a breaking change. Also, it takes away some important functionality
for some users. In a clustered environment, the IP address will not be the
same. However, for many setups, the interface name will be consistent across
the machines, so providing an interface name makes more sense in that case.
If you would like to be able to specify an IP address, the PR would need to
introduce the new property but leave the old one intact and working.
Additionally, the `customValidate` method would need to be added/updated to
ensure that only one of the properties is set.
> ListenTCP does not allow binding to subinterfaces
> -------------------------------------------------
>
> Key: NIFI-5445
> URL: https://issues.apache.org/jira/browse/NIFI-5445
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Nicholas Hughes
> Priority: Minor
>
> While attempting to bind ListenTCP to a certain interface, it was discovered
> that it does not support subinterfaces (virtual interfaces) while validating
> the contents of the "Local Network Interface" property. I traced it back to
> the ListenerProperties class [1], which uses
> "NetworkInterface.getNetworkInterfaces()" to pull a list of interfaces. This
> method does not include subinterfaces, so further iteration using the
> "getSubInterfaces()" method [2] on each interface would be required to fully
> populate the list.
> However, IP addresses are not found on the subinterfaces when using
> "getInetAddresses()" on each interface. Instead, they can be found in the
> enumeration returned by the parent interface. Further (needlessly complex)
> logic would be required to determine which IP address is being requested when
> specifying a virtual interface.
> In a scenario where someone has assigned a virtual interface on a host and
> entered the parent interface into the "Local Network Interface" property for
> ListenTCP, the code will find multiple IP addresses for that parent
> interface... but only select the first one in the list. [3] I'm uncertain as
> to how the IP addresses are ordered in the returned enumeration, but I
> suspect that unpredictable outcomes would result based upon that ordering.
> Since this logic resides in the abstract class, multiple Listen processors
> are affected.
>
> [1]
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-extension-utils/nifi-processor-utils/src/main/java/org/apache/nifi/processor/util/listen/ListenerProperties.java#L41]
> [2]
> [https://docs.oracle.com/javase/8/docs/api/java/net/NetworkInterface.html#getSubInterfaces--]
> [3]
> [https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-extension-utils/nifi-processor-utils/src/main/java/org/apache/nifi/processor/util/listen/AbstractListenEventProcessor.java#L189]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)