pt_prev in net_rx_action()

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

 




I am trying to understand the following piece of code in net_rx_action()

          struct packet_type *ptype, *pt_prev;
            unsigned short type = skb->protocol;

            pt_prev = NULL;
            for (ptype = ptype_all; ptype; ptype = ptype->next) {
                if (!ptype->dev || ptype->dev == skb->dev) {
                    if (pt_prev) {
                        if (!pt_prev->data) {
                            deliver_to_old_ones(pt_prev, skb, 0);
                        } else {
                            atomic_inc(&skb->users);
                            pt_prev->func(skb,
                                      skb->dev,
                                      pt_prev);
                        }
                    }
                    pt_prev = ptype;
                }
            }


Is there any reason why pt_prev is used instead of directly calling
ptype->func()? This causes the packet handler to be called during the next
iteration after it was found.

Thanks
Sridhar


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux