Commit 4eb28f71 authored by Johan Meiring's avatar Johan Meiring Committed by Greg Kroah-Hartman

Staging: wlan-ng: fixed coding style issues in p80211conv.c

This is a patch to the p80211conv.c file that fixes a couple of coding
style issues found by the checkpatch.pl tool.
Signed-off-by: default avatarJohan Meiring <johanmeiring@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4c510e95
...@@ -148,7 +148,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -148,7 +148,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* tack on SNAP */ /* tack on SNAP */
e_snap = e_snap =
(struct wlan_snap *) skb_push(skb, sizeof(struct wlan_snap)); (struct wlan_snap *) skb_push(skb,
sizeof(struct wlan_snap));
e_snap->type = htons(proto); e_snap->type = htons(proto);
if (ethconv == WLAN_ETHCONV_8021h if (ethconv == WLAN_ETHCONV_8021h
&& p80211_stt_findproto(proto)) { && p80211_stt_findproto(proto)) {
...@@ -161,7 +162,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, ...@@ -161,7 +162,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* tack on llc */ /* tack on llc */
e_llc = e_llc =
(struct wlan_llc *) skb_push(skb, sizeof(struct wlan_llc)); (struct wlan_llc *) skb_push(skb,
sizeof(struct wlan_llc));
e_llc->dsap = 0xAA; /* SNAP, see IEEE 802 */ e_llc->dsap = 0xAA; /* SNAP, see IEEE 802 */
e_llc->ssap = 0xAA; e_llc->ssap = 0xAA;
e_llc->ctl = 0x03; e_llc->ctl = 0x03;
...@@ -297,10 +299,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -297,10 +299,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) { if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 0)) {
memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN); memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
} else if ((WLAN_GET_FC_TODS(fc) == 0) && (WLAN_GET_FC_FROMDS(fc) == 1)) { } else if ((WLAN_GET_FC_TODS(fc) == 0)
&& (WLAN_GET_FC_FROMDS(fc) == 1)) {
memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN); memcpy(daddr, w_hdr->a3.a1, WLAN_ETHADDR_LEN);
memcpy(saddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
} else if ((WLAN_GET_FC_TODS(fc) == 1) && (WLAN_GET_FC_FROMDS(fc) == 0)) { } else if ((WLAN_GET_FC_TODS(fc) == 1)
&& (WLAN_GET_FC_FROMDS(fc) == 0)) {
memcpy(daddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN); memcpy(daddr, w_hdr->a3.a3, WLAN_ETHADDR_LEN);
memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN); memcpy(saddr, w_hdr->a3.a2, WLAN_ETHADDR_LEN);
} else { } else {
...@@ -349,7 +353,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -349,7 +353,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
e_llc = (struct wlan_llc *) (skb->data + payload_offset); e_llc = (struct wlan_llc *) (skb->data + payload_offset);
e_snap = e_snap =
(struct wlan_snap *) (skb->data + payload_offset + sizeof(struct wlan_llc)); (struct wlan_snap *) (skb->data + payload_offset +
sizeof(struct wlan_llc));
/* Test for the various encodings */ /* Test for the various encodings */
if ((payload_length >= sizeof(struct wlan_ethhdr)) && if ((payload_length >= sizeof(struct wlan_ethhdr)) &&
...@@ -372,9 +377,11 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -372,9 +377,11 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
/* chop off the 802.11 CRC */ /* chop off the 802.11 CRC */
skb_trim(skb, skb->len - WLAN_CRC_LEN); skb_trim(skb, skb->len - WLAN_CRC_LEN);
} else if ((payload_length >= sizeof(struct wlan_llc) + sizeof(struct wlan_snap)) } else if ((payload_length >= sizeof(struct wlan_llc) +
&& (e_llc->dsap == 0xaa) && (e_llc->ssap == 0xaa) sizeof(struct wlan_snap))
&& (e_llc->ctl == 0x03) &&(e_llc->dsap == 0xaa)
&& (e_llc->ssap == 0xaa)
&& (e_llc->ctl == 0x03)
&& &&
(((memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) == 0) (((memcmp(e_snap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN) == 0)
&& (ethconv == WLAN_ETHCONV_8021h) && (ethconv == WLAN_ETHCONV_8021h)
...@@ -406,21 +413,25 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, ...@@ -406,21 +413,25 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
/* chop off the 802.11 CRC */ /* chop off the 802.11 CRC */
skb_trim(skb, skb->len - WLAN_CRC_LEN); skb_trim(skb, skb->len - WLAN_CRC_LEN);
} else if ((payload_length >= sizeof(struct wlan_llc) + sizeof(struct wlan_snap)) } else if ((payload_length >= sizeof(struct wlan_llc) +
&& (e_llc->dsap == 0xaa) && (e_llc->ssap == 0xaa) sizeof(struct wlan_snap))
&& (e_llc->ctl == 0x03)) { &&(e_llc->dsap == 0xaa)
&& (e_llc->ssap == 0xaa)
&& (e_llc->ctl == 0x03)) {
pr_debug("802.1h/RFC1042 len: %d\n", payload_length); pr_debug("802.1h/RFC1042 len: %d\n", payload_length);
/* it's an 802.1h frame || (an RFC1042 && protocol is not in STT) */ /* it's an 802.1h frame || (an RFC1042 && protocol not in STT)
/* build a DIXII + RFC894 */ build a DIXII + RFC894 */
/* Test for an overlength frame */ /* Test for an overlength frame */
if ((payload_length - sizeof(struct wlan_llc) - sizeof(struct wlan_snap)) if ((payload_length - sizeof(struct wlan_llc) -
> netdev->mtu) { sizeof(struct wlan_snap))
> netdev->mtu) {
/* A bogus length ethfrm has been sent. */ /* A bogus length ethfrm has been sent. */
/* Is someone trying an oflow attack? */ /* Is someone trying an oflow attack? */
printk(KERN_ERR "DIXII frame too large (%ld > %d)\n", printk(KERN_ERR "DIXII frame too large (%ld > %d)\n",
(long int)(payload_length - sizeof(struct wlan_llc) - (long int)(payload_length -
sizeof(struct wlan_snap)), netdev->mtu); sizeof(struct wlan_llc) -
sizeof(struct wlan_snap)), netdev->mtu);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment