Skip to content

Commit

Permalink
Refactor protocol registration code
Browse files Browse the repository at this point in the history
Register wireless interface for multicast group
  • Loading branch information
n-jay committed Jul 4, 2024
1 parent 946b456 commit 162a92b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/inet/routing/leach/Leach.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void Leach::initialize(int stage) {
wasCH = false;

} else if (stage == INITSTAGE_ROUTING_PROTOCOLS) {
registerService(Protocol::manet, nullptr, gate("ipIn"));
registerProtocol(Protocol::manet, gate("ipOut"), nullptr);
registerProtocol(Protocol::manet, gate("ipOut"), gate("ipIn"));
}
}

Expand Down Expand Up @@ -79,8 +78,7 @@ void Leach::configureInterfaces() {
if (networkInterface->isMulticast()
&& interfaceMatcher.matches(
networkInterface->getInterfaceName())) {
wirelessInterface->joinMulticastGroup(
addressType->getLinkLocalManetRoutersMulticastAddress())
wirelessInterface = networkInterface;
}
}
}
Expand Down

0 comments on commit 162a92b

Please sign in to comment.