public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork•no>
To: Ben Hutchings <bhutchings@solarflare•com>
Cc: Larry Finger <Larry.Finger@lwfinger•net>,
	<linville@tuxdriver•com>, <linux-wireless@vger•kernel.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande•co.uk>,
	<netdev@vger•kernel.org>, Stable <stable@vger•kernel.org>
Subject: Re: [PATCH NEXT] rtlwifi: Fix endian error in extracting packet type
Date: Tue, 29 Oct 2013 15:27:41 +0100	[thread overview]
Message-ID: <87y55cf8yq.fsf@nemi.mork.no> (raw)
In-Reply-To: <1383005246.3779.61.camel@bwh-desktop.uk.level5networks.com> (Ben Hutchings's message of "Tue, 29 Oct 2013 00:07:26 +0000")

Ben Hutchings <bhutchings@solarflare•com> writes:

>> @@ -1077,8 +1077,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
>>  
>>  	ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
>>  			      SNAP_SIZE + PROTOC_TYPE_SIZE);
>> -	ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
>> -	/*	ether_type = ntohs(ether_type); */
>> +	ether_type = be16_to_cpu(*(__be16 *)((u8 *)skb->data + mac_hdr_len +
>> +					     SNAP_SIZE));
>>  
>>  	if (ETH_P_IP == ether_type) {
>>  		if (IPPROTO_UDP == ip->protocol) {
>
> This crazy function also says that *all* IPv6 frames are special, which
> apparently means that on TX they should get sent at the lowest possible
> bit rate.  So I think this is going to cause a regression for IPv6
> throughput unless you remove that case.
>
> The DHCP case is also not validating IP and UDP header lengths against
> the packet length, though this may be harmless in practice.

It's not validating the upper 8 bits of the port numbers either, so it
will hit random UDP traffic in addition to DHCP. 

But it was good to see this function now. I was wondering how to support
some buggy 3G modem firmware without ugly hacks. Seems there will always
be worse hacks in drivers/net, no matter what I do :-)


Bjørn

  reply	other threads:[~2013-10-29 14:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 23:28 [PATCH NEXT] rtlwifi: Fix endian error in extracting packet type Larry Finger
2013-10-29  0:07 ` Ben Hutchings
2013-10-29 14:27   ` Bjørn Mork [this message]
2013-10-29 20:16     ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y55cf8yq.fsf@nemi.mork.no \
    --to=bjorn@mork$(echo .)no \
    --cc=Larry.Finger@lwfinger$(echo .)net \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=linux-wireless@vger$(echo .)kernel.org \
    --cc=linville@tuxdriver$(echo .)com \
    --cc=mark.cave-ayland@ilande$(echo .)co.uk \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox