From: "Vitaly V. Bursov" <vitalyb@telenet.dn.ua>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] GARP protocol should not send PDUs larger than MTU
Date: Mon, 13 Jan 2014 13:54:13 +0200 [thread overview]
Message-ID: <52D3D3E5.8080602@telenet.dn.ua> (raw)
If a network interface has many vlan sub-interfaces (~400 or more) with enabled
GVRP, PDUs may become larger than the interface PDU. GARP packet generator
can send multiple PDUs, but it relies heavily on skb_tailroom() not
exceeding maximal packet size.
Patch to fix this issue is proposed, I'm not sure if it's a correct
way to handle this situation, but after a short test looks like it
works - now I get multiple PDUs with maximum size of a 1514 bytes
(1500 MTU) and switch recognizes them now.
MRP protocol can have the same problem, but I can't test it.
Signed-Off-By: Vitaly V. Bursov <vitalyb@telenet.dn.ua>
--- a/net/802/garp.c 2014-01-13 12:55:07.000000000 +0200
+++ b/net/802/garp.c 2014-01-13 12:58:30.000000000 +0200
@@ -210,6 +210,7 @@
{
struct sk_buff *skb;
struct garp_pdu_hdr *gp;
+ int extra_size;
#define LLC_RESERVE sizeof(struct llc_pdu_un)
skb = alloc_skb(app->dev->mtu + LL_RESERVED_SPACE(app->dev),
@@ -221,6 +222,13 @@
skb->protocol = htons(ETH_P_802_2);
skb_reserve(skb, LL_RESERVED_SPACE(app->dev) + LLC_RESERVE);
+ /* Reserve extra space to avoid PDUs larger than MTU,
+ * Other code depends on skb_tailroom() to return exact
+ * usable packet space left */
+ extra_size = skb_tailroom(skb) - (app->dev->mtu - LLC_RESERVE);
+ if (extra_size > 0)
+ skb_reserve(skb, extra_size);
+
gp = (struct garp_pdu_hdr *)__skb_put(skb, sizeof(*gp));
put_unaligned(htons(GARP_PROTOCOL_ID), &gp->protocol);
reply other threads:[~2014-01-13 12:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=52D3D3E5.8080602@telenet.dn.ua \
--to=vitalyb@telenet.dn.ua \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®