History

net: add skb_pop_rcv_encapsulation

This function is used by UDP encapsulation protocols in RX when crossing encapsulation boundary. If ip_summed is set to CHECKSUM_UNNECESSARY and encapsulation is not set, change to CHECKSUM_NONE since the checksum has not been validated within the encapsulation. Clears csum_valid by the same rationale.

Tom Herbert committed 12 years ago

Commit e5eb4e31 parent bbdff221 file · +12 −0Browse files

Unified · Split

include/linux/skbuff.h+12−0
@@ -1854,6 +1854,18 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) · 1853 unmodified lines
18541854 return pskb_may_pull(skb, skb_network_offset(skb) + len);
18551855 }
18561856
1857+static inline void skb_pop_rcv_encapsulation(struct sk_buff *skb)
1858+{
1859+ /* Only continue with checksum unnecessary if device indicated
1860+ * it is valid across encapsulation (skb->encapsulation was set).
1861+ */
1862+ if (skb->ip_summed == CHECKSUM_UNNECESSARY && !skb->encapsulation)
1863+ skb->ip_summed = CHECKSUM_NONE;
1864+
1865+ skb->encapsulation = 0;
1866+ skb->csum_valid = 0;
1867+}
1868+
18571869 /*
18581870 * CPUs often take a performance hit when accessing unaligned memory
18591871 * locations. The actual performance hit varies, it can be small if the

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t