pass right operation value to sMulticastGroupHandler according to join value (#35807)

diff --git a/src/inet/UDPEndPointImplSockets.cpp b/src/inet/UDPEndPointImplSockets.cpp
index 31b16c0..ed43dc0 100644
--- a/src/inet/UDPEndPointImplSockets.cpp
+++ b/src/inet/UDPEndPointImplSockets.cpp
@@ -821,7 +821,7 @@
 #if CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API
     if (sMulticastGroupHandler != nullptr)
     {
-        return sMulticastGroupHandler(aInterfaceId, aAddress, MulticastOperation::kJoin);
+        return sMulticastGroupHandler(aInterfaceId, aAddress, join ? MulticastOperation::kJoin : MulticastOperation::kLeave);
     }
 #endif // CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API