From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 2.6 5/6]: Convert udp conntrack protocol to skb_header_pointer
Date: Sun, 26 Sep 2004 23:52:22 +0200 [thread overview]
Message-ID: <41573A16.1020101@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
This patch converts the remaining parts of the udp conntrack
protocol to skb_header_pointer. Most was already done, but the
conntrack error API patch added a couple of new skb_copy_bits
calls.
[-- Attachment #2: 05.diff --]
[-- Type: text/x-patch, Size: 1670 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/26 23:18:51+02:00 kaber@coreworks.de
# [NETFILTER]: Convert udp conntrack protocol to skb_header_pointer
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv4/netfilter/ip_conntrack_proto_udp.c
# 2004/09/26 23:18:26+02:00 kaber@coreworks.de +5 -4
# [NETFILTER]: Convert udp conntrack protocol to skb_header_pointer
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv4/netfilter/ip_conntrack_proto_udp.c b/net/ipv4/netfilter/ip_conntrack_proto_udp.c
--- a/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2004-09-26 23:23:20 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_proto_udp.c 2004-09-26 23:23:20 +02:00
@@ -91,10 +91,11 @@
{
struct iphdr *iph = skb->nh.iph;
unsigned int udplen = skb->len - iph->ihl * 4;
- struct udphdr hdr;
+ struct udphdr _hdr, *hdr;
/* Header is too small? */
- if (skb_copy_bits(skb, iph->ihl*4, &hdr, sizeof(hdr)) != 0) {
+ hdr = skb_header_pointer(skb, iph->ihl*4, sizeof(_hdr), &_hdr);
+ if (hdr == NULL) {
if (LOG_INVALID(IPPROTO_UDP))
nf_log_packet(PF_INET, 0, skb, NULL, NULL,
"ip_ct_udp: short packet ");
@@ -102,7 +103,7 @@
}
/* Truncated/malformed packets */
- if (ntohs(hdr.len) > udplen || ntohs(hdr.len) < sizeof(hdr)) {
+ if (ntohs(hdr->len) > udplen || ntohs(hdr->len) < sizeof(*hdr)) {
if (LOG_INVALID(IPPROTO_UDP))
nf_log_packet(PF_INET, 0, skb, NULL, NULL,
"ip_ct_udp: truncated/malformed packet ");
@@ -110,7 +111,7 @@
}
/* Packet with no checksum */
- if (!hdr.check)
+ if (!hdr->check)
return NF_ACCEPT;
/* Checksum invalid? Ignore.
reply other threads:[~2004-09-26 21:52 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=41573A16.1020101@trash.net \
--to=kaber@trash.net \
--cc=davem@redhat.com \
--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.