Skip to contentSkip to conversation

2.6 owner-socketlookup

PATCH Applied Patrick McHardy 2 participants 2 messages Jan 17, 2004 – Jan 21, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6 owner-socketlookup

Hi Harald,

this is the 2.6 version of the owner-socketlookup patch, I had some requests for this. I don't know what the current prefered format for patch submission is, so plain patch attached. Please add to patch-o-matic.

Regards,
Patrick

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/01/17 02:24:55+01:00 [email protected]
# Lookup sockets for incoming packets in ipt_owner
#

# net/ipv4/udp.c
#   2004/01/17 02:24:48+01:00 [email protected] +1 -0
#   Lookup sockets for incoming packets in ipt_owner
# 
# net/ipv4/tcp_ipv4.c
#   2004/01/17 02:24:48+01:00 [email protected] +1 -0
#   Lookup sockets for incoming packets in ipt_owner
# 
# net/ipv4/netfilter/ipt_owner.c
#   2004/01/17 02:24:48+01:00 [email protected] +69 -24
#   Lookup sockets for incoming packets in ipt_owner
# 
# include/net/udp.h
#   2004/01/17 02:24:48+01:00 [email protected] +2 -0
#   Lookup sockets for incoming packets in ipt_owner
# 
# include/net/tcp.h
#   2004/01/17 02:24:48+01:00 [email protected] +1 -0
#   Lookup sockets for incoming packets in ipt_owner
# 
diff -Nru a/include/net/tcp.h b/include/net/tcp.h
--- a/include/net/tcp.h	Sat Jan 17 02:26:01 2004
+++ b/include/net/tcp.h	Sat Jan 17 02:26:01 2004
@@ -162,6 +162,7 @@
 extern void tcp_bucket_unlock(struct sock *sk);
 extern int tcp_port_rover;
 extern struct sock *tcp_v4_lookup_listener(u32 addr, unsigned short hnum, int dif);
+extern struct sock *tcp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 hnum, int dif);

/* These are AF independent. */
static __inline__ int tcp_bhashfn(__u16 lport)

include/net/udp.h +2 -0
diff -Nru a/include/net/udp.h b/include/net/udp.h
@@ -74,6 +74,8 @@
 extern int	udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
 extern int	udp_disconnect(struct sock *sk, int flags);
 
+extern struct sock *udp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif);
+
 DECLARE_SNMP_STAT(struct udp_mib, udp_statistics);
 #define UDP_INC_STATS(field)		SNMP_INC_STATS(udp_statistics, field)
 #define UDP_INC_STATS_BH(field)		SNMP_INC_STATS_BH(udp_statistics, field)
net/ipv4/netfilter/ipt_owner.c +69 -24

170 lines not on this page · raw message

net/ipv4/tcp_ipv4.c +1 -0
diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
@@ -2667,6 +2667,7 @@
 EXPORT_SYMBOL(tcp_v4_connect);
 EXPORT_SYMBOL(tcp_v4_do_rcv);
 EXPORT_SYMBOL(tcp_v4_lookup_listener);
+EXPORT_SYMBOL(tcp_v4_lookup);
 EXPORT_SYMBOL(tcp_v4_rebuild_header);
 EXPORT_SYMBOL(tcp_v4_remember_stamp);
 EXPORT_SYMBOL(tcp_v4_send_check);
net/ipv4/udp.c +1 -0
diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c
@@ -1540,6 +1540,7 @@
 EXPORT_SYMBOL(udp_port_rover);
 EXPORT_SYMBOL(udp_prot);
 EXPORT_SYMBOL(udp_sendmsg);
+EXPORT_SYMBOL(udp_v4_lookup);
 
 #ifdef CONFIG_PROC_FS
 EXPORT_SYMBOL(udp_proc_register);
Applied
#1 lore raw
Quoted 7 lines · Patrick McHardy

Hi Harald,

this is the 2.6 version of the owner-socketlookup patch, I had some requests for this.
I don't know what the current prefered format for patch submission is, so plain patch
attached. Please add to patch-o-matic.

thanks, applied.

Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie