From: KOVACS Krisztian <hidden@balabit.hu>
To: netdev@vger.kernel.org
Subject: [PATCH/RFC 10/13] Export UDP socket lookup function
Date: Mon, 05 Mar 2007 16:46:32 +0100 [thread overview]
Message-ID: <20070305154631.3471.85876.stgit@nienna.balabit> (raw)
In-Reply-To: <20070305154451.3471.18396.stgit@nienna.balabit>
The iptables tproxy code has to be able to do UDP socket hash lookups,
so we have to provide an exported lookup function for this purpose.
Signed-off-by: KOVACS Krisztian <hidden@balabit.hu>
---
include/net/udp.h | 4 ++++
net/ipv4/udp.c | 8 ++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/include/net/udp.h b/include/net/udp.h
index 1b921fa..ea5aa31 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -141,6 +141,10 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, int optlen,
int (*push_pending_frames)(struct sock *));
+extern struct sock *udp4_lib_lookup(__be32 saddr, __be16 sport,
+ __be32 daddr, __be16 dport,
+ int dif);
+
DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
/*
* SNMP statistics for UDP and UDP-Lite
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 1d15edc..52695a6 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -285,6 +285,14 @@ static struct sock *__udp4_lib_lookup(__be32 saddr, __be16 sport,
return result;
}
+struct sock *udp4_lib_lookup(__be32 saddr, __be16 sport,
+ __be32 daddr, __be16 dport,
+ int dif)
+{
+ return __udp4_lib_lookup(saddr, sport, daddr, dport, dif, udp_hash);
+}
+EXPORT_SYMBOL_GPL(udp4_lib_lookup);
+
static inline struct sock *udp_v4_mcast_next(struct sock *sk,
__be16 loc_port, __be32 loc_addr,
__be16 rmt_port, __be32 rmt_addr,
next prev parent reply other threads:[~2007-03-05 15:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 15:44 [PATCH/RFC 00/13] Transparent proxying patches, take two KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 01/13] Implement local diversion of IPv4 skbs KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 02/13] Port redirection support for TCP KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 03/13] Don't do the TCP socket lookup if we already have one attached KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 04/13] Don't do the UDP " KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 05/13] Loosen source address check on IPv4 output KOVACS Krisztian
2007-03-05 15:45 ` [PATCH/RFC 06/13] Implement IP_TRANSPARENT socket option KOVACS Krisztian
2007-03-05 15:46 ` [PATCH/RFC 07/13] Conditionally enable transparent flow flag when connecting KOVACS Krisztian
2007-03-05 15:46 ` [PATCH/RFC 08/13] Handle TCP SYN+ACK/ACK/RST transparency KOVACS Krisztian
2007-03-05 15:46 ` [PATCH/RFC 09/13] Create a tproxy flag in struct sk_buff KOVACS Krisztian
2007-03-05 15:46 ` KOVACS Krisztian [this message]
2007-03-05 15:46 ` [PATCH/RFC 11/13] iptables tproxy table KOVACS Krisztian
2007-03-05 15:46 ` [PATCH/RFC 12/13] iptables TPROXY target KOVACS Krisztian
2007-03-05 15:47 ` [PATCH/RFC 13/13] iptables tproxy match KOVACS Krisztian
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=20070305154631.3471.85876.stgit@nienna.balabit \
--to=hidden@balabit.hu \
--cc=netdev@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