| Submitter | David Miller |
|---|---|
| Date | Dec. 21, 2010, 8:57 p.m. |
| Message ID | <20101221.125743.115954170.davem@davemloft.net> |
| Download | mbox | patch |
| Permalink | /patch/76330/ |
| State | Accepted |
| Delegated to: | David Miller |
| Headers | show |
Comments
Patch
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index dd3031a..9fcc680 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -323,7 +323,9 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) static inline int tcf_valid_offset(const struct sk_buff *skb, const unsigned char *ptr, const int len) { - return unlikely((ptr + len) < skb_tail_pointer(skb) && ptr > skb->head); + return likely((ptr + len) <= skb_tail_pointer(skb) && + ptr >= skb->head && + (ptr <= (ptr + len))); } #ifdef CONFIG_NET_CLS_IND