diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-06-19 19:22:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-19 19:22:28 -0400 |
commit | 4497b0763cb1afae463f5e144c28b5d806e28b60 (patch) | |
tree | 3e86c53b5eb461eac7523885e43f36033cc03968 /include | |
parent | 0187bdfb05674147774ca79a79942537f3ad54bd (diff) |
net: Discard and warn about LRO'd skbs received for forwarding
Add skb_warn_if_lro() to test whether an skb was received with LRO and
warn if so.
Change br_forward(), ip_forward() and ip6_forward() to call it) and
discard the skb if it returns true.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 299ec4b31412..2220b9e2dab0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1702,6 +1702,20 @@ static inline int skb_is_gso_v6(const struct sk_buff *skb) | |||
1702 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; | 1702 | return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; |
1703 | } | 1703 | } |
1704 | 1704 | ||
1705 | extern void __skb_warn_lro_forwarding(const struct sk_buff *skb); | ||
1706 | |||
1707 | static inline bool skb_warn_if_lro(const struct sk_buff *skb) | ||
1708 | { | ||
1709 | /* LRO sets gso_size but not gso_type, whereas if GSO is really | ||
1710 | * wanted then gso_type will be set. */ | ||
1711 | struct skb_shared_info *shinfo = skb_shinfo(skb); | ||
1712 | if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) { | ||
1713 | __skb_warn_lro_forwarding(skb); | ||
1714 | return true; | ||
1715 | } | ||
1716 | return false; | ||
1717 | } | ||
1718 | |||
1705 | static inline void skb_forward_csum(struct sk_buff *skb) | 1719 | static inline void skb_forward_csum(struct sk_buff *skb) |
1706 | { | 1720 | { |
1707 | /* Unfortunately we don't support this one. Any brave souls? */ | 1721 | /* Unfortunately we don't support this one. Any brave souls? */ |