netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header
@ 2005-03-23 17:34 Vicente Feito
  2005-03-23 20:50 ` Jeff Garzik
  2005-03-23 20:52 ` Jon Mason
  0 siblings, 2 replies; 5+ messages in thread
From: Vicente Feito @ 2005-03-23 17:34 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

Hi,
Please consider applying (or droping).
Thank you.

Description: This patch prevent drivers from calling eth_header with a 802.3
frame using a len>1536. In such a case returns -EINVAL, which was hard to
choose because the ETH_HLEN is supposed to return.

Signed-off-by: Vicente Feito <vicente.feito@gmail.com>

[-- Attachment #2: eth.patch --]
[-- Type: text/x-diff, Size: 520 bytes --]

--- linux-2.6.12-rc1-mm1/net/ethernet/eth.c.orig	2005-03-22 12:49:08.000000000 +0000
+++ linux-2.6.12-rc1-mm1/net/ethernet/eth.c	2005-03-22 12:49:36.000000000 +0000
@@ -78,6 +78,8 @@ int eth_header(struct sk_buff *skb, stru
 {
 	struct ethhdr *eth = (struct ethhdr *)skb_push(skb,ETH_HLEN);
 
+	if (type == ETH_P_802_3 && len >= 1536)
+		return -EINVAL;
 	/* 
 	 *	Set the protocol type. For a packet of type ETH_P_802_3 we put the length
 	 *	in here instead. It is up to the 802.2 layer to carry protocol information.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header
  2005-03-23 20:50 ` Jeff Garzik
@ 2005-03-23 18:15   ` Vicente Feito
  2005-03-23 21:25     ` Jon Mason
  0 siblings, 1 reply; 5+ messages in thread
From: Vicente Feito @ 2005-03-23 18:15 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

On Wednesday 23 March 2005 08:50 pm, Jeff Garzik wrote:
> Vicente Feito wrote:
> > Hi,
> > Please consider applying (or droping).
> > Thank you.
> >
> > Description: This patch prevent drivers from calling eth_header with a
> > 802.3 frame using a len>1536. In such a case returns -EINVAL, which was
> > hard to choose because the ETH_HLEN is supposed to return.
> >
> > Signed-off-by: Vicente Feito <vicente.feito@gmail.com>
> >
> >
> > ------------------------------------------------------------------------
> >
> > --- linux-2.6.12-rc1-mm1/net/ethernet/eth.c.orig 2005-03-22
> > 12:49:08.000000000 +0000 +++
> > linux-2.6.12-rc1-mm1/net/ethernet/eth.c 2005-03-22 12:49:36.000000000
> > +0000 @@ -78,6 +78,8 @@ int eth_header(struct sk_buff *skb, stru
> >  {
> >   struct ethhdr *eth = (struct ethhdr *)skb_push(skb,ETH_HLEN);
> >
> > + if (type == ETH_P_802_3 && len >= 1536)
> > +  return -EINVAL;
>
> Why?  Won't this break for jumbo frames?
>
>  Jeff
True, I completely forgot about it, I was having problems with a driver and I 
though this would be a correct approach for size violation avoidance, but I 
guess it doesn't have much sense to change len >= 1536 by the 9000 of a jumbo 
packet, sorry.

Vicente

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header
  2005-03-23 17:34 [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header Vicente Feito
@ 2005-03-23 20:50 ` Jeff Garzik
  2005-03-23 18:15   ` Vicente Feito
  2005-03-23 20:52 ` Jon Mason
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2005-03-23 20:50 UTC (permalink / raw)
  To: Vicente Feito; +Cc: David S. Miller, netdev

Vicente Feito wrote:
> Hi,
> Please consider applying (or droping).
> Thank you.
> 
> Description: This patch prevent drivers from calling eth_header with a 802.3
> frame using a len>1536. In such a case returns -EINVAL, which was hard to
> choose because the ETH_HLEN is supposed to return.
> 
> Signed-off-by: Vicente Feito <vicente.feito@gmail.com>
> 
> 
> ------------------------------------------------------------------------
> 
> --- linux-2.6.12-rc1-mm1/net/ethernet/eth.c.orig	2005-03-22 12:49:08.000000000 +0000
> +++ linux-2.6.12-rc1-mm1/net/ethernet/eth.c	2005-03-22 12:49:36.000000000 +0000
> @@ -78,6 +78,8 @@ int eth_header(struct sk_buff *skb, stru
>  {
>  	struct ethhdr *eth = (struct ethhdr *)skb_push(skb,ETH_HLEN);
>  
> +	if (type == ETH_P_802_3 && len >= 1536)
> +		return -EINVAL;

Why?  Won't this break for jumbo frames?

	Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header
  2005-03-23 17:34 [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header Vicente Feito
  2005-03-23 20:50 ` Jeff Garzik
@ 2005-03-23 20:52 ` Jon Mason
  1 sibling, 0 replies; 5+ messages in thread
From: Jon Mason @ 2005-03-23 20:52 UTC (permalink / raw)
  To: Vicente Feito; +Cc: David S. Miller, netdev

On Wednesday 23 March 2005 11:34 am, Vicente Feito wrote:
> Hi,
> Please consider applying (or droping).
> Thank you.
>
> Description: This patch prevent drivers from calling eth_header with a
> 802.3 frame using a len>1536. In such a case returns -EINVAL, which was
> hard to choose because the ETH_HLEN is supposed to return.

Won't this break jumbo frames?

-- 
Jon Mason
jdmason@us.ibm.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header
  2005-03-23 18:15   ` Vicente Feito
@ 2005-03-23 21:25     ` Jon Mason
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2005-03-23 21:25 UTC (permalink / raw)
  To: Vicente Feito; +Cc: Jeff Garzik, netdev

On Wednesday 23 March 2005 12:15 pm, Vicente Feito wrote:
> On Wednesday 23 March 2005 08:50 pm, Jeff Garzik wrote:
> > Vicente Feito wrote:
> > > Hi,
> > > Please consider applying (or droping).
> > > Thank you.
> > >
> > > Description: This patch prevent drivers from calling eth_header with a
> > > 802.3 frame using a len>1536. In such a case returns -EINVAL, which was
> > > hard to choose because the ETH_HLEN is supposed to return.
> > >
> > > Signed-off-by: Vicente Feito <vicente.feito@gmail.com>
> > >
> > >
> > > -----------------------------------------------------------------------
> > >-
> > >
> > > --- linux-2.6.12-rc1-mm1/net/ethernet/eth.c.orig 2005-03-22
> > > 12:49:08.000000000 +0000 +++
> > > linux-2.6.12-rc1-mm1/net/ethernet/eth.c 2005-03-22 12:49:36.000000000
> > > +0000 @@ -78,6 +78,8 @@ int eth_header(struct sk_buff *skb, stru
> > >  {
> > >   struct ethhdr *eth = (struct ethhdr *)skb_push(skb,ETH_HLEN);
> > >
> > > + if (type == ETH_P_802_3 && len >= 1536)
> > > +  return -EINVAL;
> >
> > Why?  Won't this break for jumbo frames?
> >
> >  Jeff
>
> True, I completely forgot about it, I was having problems with a driver and
> I though this would be a correct approach for size violation avoidance, but
> I guess it doesn't have much sense to change len >= 1536 by the 9000 of a
> jumbo packet, sorry.

Jumbo Frames can be upto 16k.

-- 
Jon Mason
jdmason@us.ibm.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-03-23 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-23 17:34 [PATCH 2.6.12-rc1-mm1] net/ethernet/eth.c - eth_header Vicente Feito
2005-03-23 20:50 ` Jeff Garzik
2005-03-23 18:15   ` Vicente Feito
2005-03-23 21:25     ` Jon Mason
2005-03-23 20:52 ` Jon Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).