Dealing with shared/cloned skbs?

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

 



Hi,

in the 2.4 net/ipv4/netfilter directory various ways are used to
check whether an skb needs to be copied before it is modified. At
least three ways are used:

if (skb_shared(skb) || skb_cloned(skb))

if (skb_cloned(skb) && !skb->sk)

if (skb_cloned(skb))

And at the places where the skb is actually copied some of them do:

	if ((oldskb)->sk)
		skb_set_owner_w(newskb, oldskb->sk);

while some of them do not.

What is the correct way to know if an skb needs to be copied before
modified, and what should be done after a copy takes place?

//Marcus
--
---------------------------------------+--------------------------
  Marcus Sundberg <marcus@xxxxxxxxxx>  | Firewalls with SIP & NAT
 Software Developer, Ingate Systems AB |  http://www.ingate.com/
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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