From: Paul Durrant <paul.durrant@citrix.com>
To: jeremy@goop.org, xen-devel@lists.xensource.com
Cc: Paul Durrant <paul.durrant@citrix.com>
Subject: [PATCH] Re-define PKT_PROT_LEN to be bigger.
Date: Wed, 15 Dec 2010 09:48:12 +0000 [thread overview]
Message-ID: <1292406492-20516-1-git-send-email-paul.durrant@citrix.com> (raw)
Re-define PKT_PROT_LEN to be big enough to handle maximal IPv4 and TCP options and phrase
the definition so that it's reasonably obvious that's what it's for.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
drivers/xen/netback/netback.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c
index c448675..368daa6 100644
--- a/drivers/xen/netback/netback.c
+++ b/drivers/xen/netback/netback.c
@@ -36,9 +36,11 @@
#include "common.h"
-#include <linux/tcp.h>
-#include <linux/udp.h>
#include <linux/kthread.h>
+#include <linux/if_vlan.h>
+#include <linux/udp.h>
+
+#include <net/tcp.h>
#include <xen/balloon.h>
#include <xen/events.h>
@@ -125,10 +127,12 @@ static inline int netif_get_page_ext(struct page *pg, unsigned int *_group, unsi
/*
* This is the amount of packet we copy rather than map, so that the
* guest can't fiddle with the contents of the headers while we do
- * packet processing on them (netfilter, routing, etc). 72 is enough
- * to cover TCP+IP headers including options.
+ * packet processing on them (netfilter, routing, etc).
*/
-#define PKT_PROT_LEN 72
+#define PKT_PROT_LEN (ETH_HLEN + \
+ VLAN_HLEN + \
+ sizeof(struct iphdr) + MAX_IPOPTLEN + \
+ sizeof(struct tcphdr) + MAX_TCP_OPTION_SPACE)
static inline pending_ring_idx_t pending_index(unsigned i)
{
--
1.5.6.5
next reply other threads:[~2010-12-15 9:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 9:48 Paul Durrant [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-12-14 20:35 [PATCH] Re-define PKT_PROT_LEN to be bigger Paul Durrant
2010-12-14 22:17 ` Jeremy Fitzhardinge
2010-12-15 9:30 ` Paul Durrant
2010-12-15 9:37 ` Ian Campbell
2010-12-20 14:34 ` Ian Campbell
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=1292406492-20516-1-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=jeremy@goop.org \
--cc=xen-devel@lists.xensource.com \
/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;
as well as URLs for NNTP newsgroup(s).