public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Guo-Fu Tseng" <cooldavid@cooldavid•org>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org, arieslee@jmicron•com,
	devinchiu@jmicron•com, ethanhsiao@jmicron•com
Subject: Re: [PATCH net-next-2.6 8/9] jme: Don't show UDP Checksum error if HW misjudged
Date: Mon, 14 Feb 2011 13:13:01 +0800	[thread overview]
Message-ID: <20110214051218.M85443@cooldavid.org> (raw)
In-Reply-To: <20110213.204300.186319004.davem@davemloft.net>

On Sun, 13 Feb 2011 20:43:00 -0800 (PST), David Miller wrote
> From: "Guo-Fu Tseng" <cooldavid@cooldavid•org>
> Date: Mon, 14 Feb 2011 12:27:41 +0800
> 
> > @@ -956,8 +956,27 @@ jme_disable_rx_engine(struct jme_adapter *jme)
> >  	jme_mac_rxclk_off(jme);
> >  }
> >  
> > +static u16
> > +jme_udpsum(struct sk_buff *skb)
> > +{
> > +	u16 csum = 0xFFFFu;
> > +
> > +	if (skb->protocol != htons(ETH_P_IP))
> > +		return csum;
> > +	skb_set_network_header(skb, ETH_HLEN);
> > +	if (ip_hdr(skb)->protocol != IPPROTO_UDP)
> > +		return csum;
> > +	skb_set_transport_header(skb,
> > +			ETH_HLEN + (ip_hdr(skb)->ihl << 2));
> > +	csum = udp_hdr(skb)->check;
> > +	skb_reset_transport_header(skb);
> > +	skb_reset_network_header(skb);
> > +
> > +	return csum;
> > +}
> 
> You need to validate the packet length in all of these packet header
> accesses, otherwise you're potentially looking at garbage.
Thank you!
Redoing this path, I'll send it later. :)

Guo-Fu Tseng


  reply	other threads:[~2011-02-14  5:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  4:27 [PATCH net-next-2.6 1/9] jme: Extract main and sub chip revision Guo-Fu Tseng
2011-02-14  4:27 ` [PATCH net-next-2.6 2/9] jme: PHY Power control for new chip Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 3/9] jme: Fix bit typo of JMC250A2 workaround Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 4/9] jme: Rename phyfifo function for easier understand Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 5/9] jme: Fix hardware action of full-duplex Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 6/9] jme: Safer MAC processor reset sequence Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 7/9] jme: Refill receive unicase MAC addr after resume Guo-Fu Tseng
2011-02-14  4:44   ` David Miller
2011-02-14  4:27 ` [PATCH net-next-2.6 8/9] jme: Don't show UDP Checksum error if HW misjudged Guo-Fu Tseng
2011-02-14  4:43   ` David Miller
2011-02-14  5:13     ` Guo-Fu Tseng [this message]
2011-02-14  4:27 ` [PATCH net-next-2.6 9/9] jme: Advance driver version Guo-Fu Tseng
2011-02-14  4:44 ` [PATCH net-next-2.6 1/9] jme: Extract main and sub chip revision David Miller

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=20110214051218.M85443@cooldavid.org \
    --to=cooldavid@cooldavid$(echo .)org \
    --cc=arieslee@jmicron$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=devinchiu@jmicron$(echo .)com \
    --cc=ethanhsiao@jmicron$(echo .)com \
    --cc=netdev@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