提交 c9c6950c 编写于 作者: H Harvey Harrison 提交者: John W. Linville

mac80211: make ieee80211_get_hdrlen_from_skb return unsigned

Many callers already expect it to.
Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 8b7b1e05
......@@ -1535,7 +1535,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
*
* @skb: the frame
*/
int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
/**
* ieee80211_get_hdrlen - get header length from frame control
......
......@@ -133,14 +133,14 @@ int ieee80211_get_hdrlen(u16 fc)
}
EXPORT_SYMBOL(ieee80211_get_hdrlen);
int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
{
const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) skb->data;
int hdrlen;
const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *)skb->data;
unsigned int hdrlen;
if (unlikely(skb->len < 10))
return 0;
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
hdrlen = ieee80211_hdrlen(hdr->frame_control);
if (unlikely(hdrlen > skb->len))
return 0;
return hdrlen;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册