Skip to content

Failure to set IP_MULTICAST_IF should be fatal #129

@mdavidsaver

Description

@mdavidsaver

https://epics.anl.gov/core-talk/2022/msg00456.php

Mentions #93 as fixing an "escape" of 224.0.0.128 multicast traffic which should be limited to the loopback interface. A more complete fix should treat failure to set IP_MULTICAST_IF as a fatal error. Instead, currently a message is logged, and the socket is used anyway.

try {
InetAddress group = InetAddress.getByName("224.0.0.128");
localBroadcastAddress = new InetSocketAddress(group, broadcastPort);
searchTransport.join(group, localNIF);
// NOTE: this disables usage of multicast addresses in EPICS_PVA_ADDR_LIST
searchTransport.setMutlicastNIF(localNIF, true);
logger.config("Local multicast enabled on " + localBroadcastAddress + ":" + broadcastPort
+ " using " + localNIF.getDisplayName() + ".");
} catch (Exception th) {
logger.log(Level.CONFIG, "Failed to initialize local multicast, funcionality disabled.", th);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions