The IP_LEAVE_MEMBERSHIP Socket Option
This option is invoked to denote that a socket or application is no longer interested in receiving data from that multicast group. Internally, the option is implemented by ip_mc_leave_group(). However, this does not automatically mean that the computer won't receive any more packets for the multicast group. The computer's membership in the group is terminated only when no application is any longer interested in the group. Packets for groups that the computer is no longer interested in are simply ignored by the kernel.
The computer in the above example could leave the group as follows: