Locally transmitted Multicast packets are being looped back, even if IP_MULTICAST_LOOP option is set to zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am Vijay Tandeker working in TejasNetworks Bangalore, which works in a telecommunication domain. I have one query regarding IP_MULTICAST_LOOP option.

My configuration:
Kernel version: 2.6.32
One OSPF routing protocol deamon is running in my system. It has opened one raw socket with
- IP_HDRINCL option set to 1
- IP_MULTICAST_LOOP option set to 0

IP fragmentation logic is implemented in my application. Means if OSPF tries to send any packet which exceeds MTU of the transmitting interface, it fragments it and gives to the kernel using sendmsg(). In my case, I am getting all my fragmented packets back to the application (which should not happen if IP_MULTICAST_LOOP option is set to zero).

Following are my observations:
1) In ip_mc_output() function inside "net/ipv4/ip_output.c" file:


/*
 *  Multicasts are looped back for other local users
 */

    if (rt->rt_flags&RTCF_MULTICAST) {
        if ((!sk || inet_sk(sk)->mc_loop)
#ifdef CONFIG_IP_MROUTE
                /* Small optimization: do not loopback not local frames,
                   which returned after forwarding; they will be  dropped
                   by ip_mr_input in any case.
                   Note, that local frames are looped back to be delivered
                   to local recipients.

                   This check is duplicated in ip_mr_input at the moment.
                 */
&& ((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))
#endif
           ) {
             }

Here sk(or skb->sk) pointer is NULL and "((rt->rt_flags&RTCF_LOCAL) || !(IPCB(skb)->flags&IPSKB_FORWARDED))" condition is True. Because of this I am getting all my fragmented packets looped back to application.



 2) On further debugging I found that:
In nf_ct_ipv4_gather_frags() function inside "ipv4/netfilter/nf_defrag_ipv4.c" file
 - skb_orphan(skb); is being called, which is setting skb->sk to NULL.
 - No call to restore skb->sk back to some valid value later on.

My questions:-
 - Is this done intentionally ?
 - If No, please suggest the solution to restore skb->sk pointer.
 - If Yes, please suggest the solution to restore skb->sk pointer.

Kindly let me know in case if the problem is not clear or you need any more data.

 Thanks & Regards,
 Vijay


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux