From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 2.6 4/9]: Handle nonlinear skbs in ip_queue/ip6_queue
Date: Mon, 15 Nov 2004 22:44:39 +0100 [thread overview]
Message-ID: <41992347.5030302@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 159 bytes --]
Handle nonlinear skbs in ip_queue/ip6_queue. This, in addition to Yasuyuki's
patches, is the last change necessary to remove skb_linearize from
ip6_tables.
[-- Attachment #2: 04.diff --]
[-- Type: text/x-patch, Size: 1942 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/11/13 11:55:57+01:00 kaber@coreworks.de
# [NETFILTER]: Handle nonlinear skbs in ip_queue/ip6_queue
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv6/netfilter/ip6_queue.c
# 2004/11/13 11:55:50+01:00 kaber@coreworks.de +4 -1
# [NETFILTER]: Handle nonlinear skbs in ip_queue/ip6_queue
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv4/netfilter/ip_queue.c
# 2004/11/13 11:55:50+01:00 kaber@coreworks.de +4 -1
# [NETFILTER]: Handle nonlinear skbs in ip_queue/ip6_queue
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
--- a/net/ipv4/netfilter/ip_queue.c 2004-11-15 22:07:01 +01:00
+++ b/net/ipv4/netfilter/ip_queue.c 2004-11-15 22:07:01 +01:00
@@ -257,7 +257,8 @@
}
if (data_len)
- memcpy(pmsg->payload, entry->skb->data, data_len);
+ if (skb_copy_bits(entry->skb, 0, pmsg->payload, data_len))
+ BUG();
nlh->nlmsg_len = skb->tail - old_tail;
return skb;
@@ -362,6 +363,8 @@
}
skb_put(e->skb, diff);
}
+ if (!skb_ip_make_writable(&e->skb, v->data_len))
+ return -ENOMEM;
memcpy(e->skb->data, v->payload, v->data_len);
e->skb->nfcache |= NFC_ALTERED;
diff -Nru a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
--- a/net/ipv6/netfilter/ip6_queue.c 2004-11-15 22:07:01 +01:00
+++ b/net/ipv6/netfilter/ip6_queue.c 2004-11-15 22:07:01 +01:00
@@ -262,7 +262,8 @@
}
if (data_len)
- memcpy(pmsg->payload, entry->skb->data, data_len);
+ if (skb_copy_bits(entry->skb, 0, pmsg->payload, data_len))
+ BUG();
nlh->nlmsg_len = skb->tail - old_tail;
return skb;
@@ -366,6 +367,8 @@
}
skb_put(e->skb, diff);
}
+ if (!skb_ip_make_writable(&e->skb, v->data_len))
+ return -ENOMEM;
memcpy(e->skb->data, v->payload, v->data_len);
e->skb->nfcache |= NFC_ALTERED;
reply other threads:[~2004-11-15 21:44 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=41992347.5030302@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.