public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Mika Penttilä" <mika.penttila@kolumbus•fi>
To: Jon Mason <jdmason@kudzu•us>
Cc: shemminger@osdl•org, netdev@vger•kernel.org
Subject: Re: [PATCH] bridge: add ETH_HLEN to packet_length
Date: Thu, 14 Sep 2006 23:53:48 +0300	[thread overview]
Message-ID: <4509C15C.6080308@kolumbus.fi> (raw)
In-Reply-To: <20060914182751.GA15203@kudzu.us>

Jon Mason wrote:
> In br_dev_queue_push_xmit, why is the check to drop mtu oversized
> packets not checking for enough room for the impending ETH_HLEN size
> skb_push?  In some code currently under development, we are seeing
> skb_under_panic being called from the "skb_push(skb, ETH_HLEN)" in that
> code.  It seems to me it would be better to drop those skbs than panic.
> Attached is a patch to do this.
>
> Thanks,
> Jon
>
> Signed-off-by: Jon Mason <jdmason@kudzu•us>
>
> diff -r b1d36669f98d net/bridge/br_forward.c
> --- a/net/bridge/br_forward.c	Mon Sep  4 03:00:04 2006 +0000
> +++ b/net/bridge/br_forward.c	Thu Sep 14 13:18:04 2006 -0500
> @@ -29,7 +29,8 @@ static inline int should_deliver(const s
>  
>  static inline unsigned packet_length(const struct sk_buff *skb)
>  {
> -	return skb->len - (skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0);
> +	return skb->len - ETH_HLEN - 
> +		(skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0);
>  }
>
>   
packet_length() is a wrong place to do that, mtu has nothing to do with 
skb headroom.

--Mika


  reply	other threads:[~2006-09-14 20:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 18:27 [PATCH] bridge: add ETH_HLEN to packet_length Jon Mason
2006-09-14 20:53 ` Mika Penttilä [this message]
2006-09-15  0:31   ` Jon Mason
2006-09-15  0:57 ` Stephen Hemminger

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=4509C15C.6080308@kolumbus.fi \
    --to=mika.penttila@kolumbus$(echo .)fi \
    --cc=jdmason@kudzu$(echo .)us \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=shemminger@osdl$(echo .)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