Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48122
b: refs/heads/master
c: 1b51d3a
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Feb 12, 2007
1 parent 3998ee8 commit 092ac52
Show file tree
Hide file tree
Showing 75 changed files with 720 additions and 784 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89697f1d715e20fff0361cca79efd5a371623af7
refs/heads/master: 1b51d3a08b6c80a1e47d4c579c41abbe56cd3c44
8 changes: 0 additions & 8 deletions trunk/arch/sparc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@ config LARGE_ALLOCS

source "mm/Kconfig"

config ZONE_DMA
bool
default y

config GENERIC_ISA_DMA
bool
default y

config ISA
bool
help
Expand Down
13 changes: 8 additions & 5 deletions trunk/arch/sparc64/defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20
# Sat Feb 10 23:08:12 2007
# Sun Feb 11 23:47:40 2007
#
CONFIG_SPARC=y
CONFIG_SPARC64=y
Expand Down Expand Up @@ -49,7 +49,6 @@ CONFIG_POSIX_MQUEUE=y
# CONFIG_IKCONFIG is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_RELAY=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
Expand Down Expand Up @@ -144,7 +143,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y
CONFIG_SPARSEMEM_EXTREME=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_ZONE_DMA_FLAG=0
CONFIG_SBUS=y
CONFIG_SBUSCHAR=y
CONFIG_SUN_AUXIO=y
Expand Down Expand Up @@ -1259,6 +1258,10 @@ CONFIG_USB_HIDDEV=y
# DMA Devices
#

#
# Auxiliary Display support
#

#
# Virtualization
#
Expand Down Expand Up @@ -1450,7 +1453,6 @@ CONFIG_SCHEDSTATS=y
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_RWSEMS is not set
# CONFIG_DEBUG_LOCK_ALLOC is not set
# CONFIG_PROVE_LOCKING is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
Expand Down Expand Up @@ -1533,4 +1535,5 @@ CONFIG_LIBCRC32C=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_PLIST=y
CONFIG_IOMAP_COPY=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
4 changes: 2 additions & 2 deletions trunk/arch/sparc64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,8 +1467,8 @@ void __init paging_init(void)
for (znum = 0; znum < MAX_NR_ZONES; znum++)
zones_size[znum] = zholes_size[znum] = 0;

zones_size[ZONE_DMA] = end_pfn;
zholes_size[ZONE_DMA] = end_pfn - pages_avail;
zones_size[ZONE_NORMAL] = end_pfn;
zholes_size[ZONE_NORMAL] = end_pfn - pages_avail;

free_area_init_node(0, &contig_page_data, zones_size,
__pa(PAGE_OFFSET) >> PAGE_SHIFT,
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/netfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ struct nf_logger {

/* Function to register/unregister log function. */
int nf_log_register(int pf, struct nf_logger *logger);
void nf_log_unregister(struct nf_logger *logger);
void nf_log_unregister_pf(int pf);
int nf_log_unregister_pf(int pf);
void nf_log_unregister_logger(struct nf_logger *logger);

/* Calls the registered backend logging function */
void nf_log_packet(int pf,
Expand Down
6 changes: 0 additions & 6 deletions trunk/include/linux/netfilter_ipv4/ip_conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,6 @@ extern unsigned int ip_conntrack_htable_size;
extern int ip_conntrack_checksum;

#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
#define CONNTRACK_STAT_INC_ATOMIC(count) \
do { \
local_bh_disable(); \
__get_cpu_var(ip_conntrack_stat).count++; \
local_bh_enable(); \
} while (0)

#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
#include <linux/notifier.h>
Expand Down
6 changes: 0 additions & 6 deletions trunk/include/net/netfilter/nf_conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ extern int nf_conntrack_max;

DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat);
#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++)
#define NF_CT_STAT_INC_ATOMIC(count) \
do { \
local_bh_disable(); \
__get_cpu_var(nf_conntrack_stat).count++; \
local_bh_enable(); \
} while (0)

/* no helper, no nat */
#define NF_CT_F_BASIC 0
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/net/netfilter/nf_conntrack_l3proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX];

/* Protocol registration. */
extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto);
extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto);
extern int nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto);

extern struct nf_conntrack_l3proto *
nf_ct_l3proto_find_get(u_int16_t l3proto);
Expand All @@ -106,7 +106,7 @@ __nf_ct_l3proto_find(u_int16_t l3proto)
{
if (unlikely(l3proto >= AF_MAX))
return &nf_conntrack_l3proto_generic;
return rcu_dereference(nf_ct_l3protos[l3proto]);
return nf_ct_l3protos[l3proto];
}

#endif /*_NF_CONNTRACK_L3PROTO_H*/
2 changes: 1 addition & 1 deletion trunk/include/net/netfilter/nf_conntrack_l4proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p);

/* Protocol registration. */
extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto);
extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto);
extern int nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto);

/* Generic netlink helpers */
extern int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/bridge/netfilter/ebt_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int __init ebt_log_init(void)

static void __exit ebt_log_fini(void)
{
nf_log_unregister(&ebt_log_logger);
nf_log_unregister_logger(&ebt_log_logger);
ebt_unregister_watcher(&log);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/bridge/netfilter/ebt_ulog.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static void __exit ebt_ulog_fini(void)
ebt_ulog_buff_t *ub;
int i;

nf_log_unregister(&ebt_ulog_logger);
nf_log_unregister_logger(&ebt_ulog_logger);
ebt_unregister_watcher(&ulog);
for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) {
ub = &ulog_buffers[i];
Expand Down
8 changes: 3 additions & 5 deletions trunk/net/ipv4/netfilter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ config IP_NF_QUEUE

config IP_NF_IPTABLES
tristate "IP tables support (required for filtering/masq/NAT)"
select NETFILTER_XTABLES
depends on NETFILTER_XTABLES
help
iptables is a general, extensible packet identification framework.
The packet filtering and full NAT (masquerading, port forwarding,
Expand Down Expand Up @@ -606,9 +606,7 @@ config IP_NF_TARGET_TTL
config IP_NF_TARGET_CLUSTERIP
tristate "CLUSTERIP target support (EXPERIMENTAL)"
depends on IP_NF_MANGLE && EXPERIMENTAL
depends on IP_NF_CONNTRACK || NF_CONNTRACK_IPV4
select IP_NF_CONNTRACK_MARK if IP_NF_CONNTRACK
select NF_CONNTRACK_MARK if NF_CONNTRACK_IPV4
depends on (IP_NF_CONNTRACK && IP_NF_CONNTRACK_MARK) || (NF_CONNTRACK_MARK && NF_CONNTRACK_IPV4)
help
The CLUSTERIP target allows you to build load-balancing clusters of
network servers without having a dedicated load-balancing
Expand All @@ -631,7 +629,7 @@ config IP_NF_RAW
# ARP tables
config IP_NF_ARPTABLES
tristate "ARP tables support"
select NETFILTER_XTABLES
depends on NETFILTER_XTABLES
help
arptables is a general, extensible packet identification framework.
The ARP packet filtering and mangling (manipulation)subsystems
Expand Down
51 changes: 19 additions & 32 deletions trunk/net/ipv4/netfilter/ip_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ destroy_conntrack(struct nf_conntrack *nfct)
struct ip_conntrack *ct = (struct ip_conntrack *)nfct;
struct ip_conntrack_protocol *proto;
struct ip_conntrack_helper *helper;
typeof(ip_conntrack_destroyed) destroyed;

DEBUGP("destroy_conntrack(%p)\n", ct);
IP_NF_ASSERT(atomic_read(&nfct->use) == 0);
Expand All @@ -319,16 +318,12 @@ destroy_conntrack(struct nf_conntrack *nfct)
/* To make sure we don't get any weird locking issues here:
* destroy_conntrack() MUST NOT be called with a write lock
* to ip_conntrack_lock!!! -HW */
rcu_read_lock();
proto = __ip_conntrack_proto_find(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.protonum);
if (proto && proto->destroy)
proto->destroy(ct);

destroyed = rcu_dereference(ip_conntrack_destroyed);
if (destroyed)
destroyed(ct);

rcu_read_unlock();
if (ip_conntrack_destroyed)
ip_conntrack_destroyed(ct);

write_lock_bh(&ip_conntrack_lock);
/* Expectations will have been removed in clean_from_lists,
Expand Down Expand Up @@ -541,7 +536,7 @@ static int early_drop(struct list_head *chain)
if (del_timer(&ct->timeout)) {
death_by_timeout((unsigned long)ct);
dropped = 1;
CONNTRACK_STAT_INC_ATOMIC(early_drop);
CONNTRACK_STAT_INC(early_drop);
}
ip_conntrack_put(ct);
return dropped;
Expand Down Expand Up @@ -600,13 +595,13 @@ ip_conntrack_proto_find_get(u_int8_t protocol)
{
struct ip_conntrack_protocol *p;

rcu_read_lock();
preempt_disable();
p = __ip_conntrack_proto_find(protocol);
if (p) {
if (!try_module_get(p->me))
p = &ip_conntrack_generic_protocol;
}
rcu_read_unlock();
preempt_enable();

return p;
}
Expand Down Expand Up @@ -807,7 +802,7 @@ unsigned int ip_conntrack_in(unsigned int hooknum,

/* Previously seen (loopback or untracked)? Ignore. */
if ((*pskb)->nfct) {
CONNTRACK_STAT_INC_ATOMIC(ignore);
CONNTRACK_STAT_INC(ignore);
return NF_ACCEPT;
}

Expand Down Expand Up @@ -835,28 +830,27 @@ unsigned int ip_conntrack_in(unsigned int hooknum,
}
#endif

/* rcu_read_lock()ed by nf_hook_slow */
proto = __ip_conntrack_proto_find((*pskb)->nh.iph->protocol);

/* It may be an special packet, error, unclean...
* inverse of the return code tells to the netfilter
* core what to do with the packet. */
if (proto->error != NULL
&& (ret = proto->error(*pskb, &ctinfo, hooknum)) <= 0) {
CONNTRACK_STAT_INC_ATOMIC(error);
CONNTRACK_STAT_INC_ATOMIC(invalid);
CONNTRACK_STAT_INC(error);
CONNTRACK_STAT_INC(invalid);
return -ret;
}

if (!(ct = resolve_normal_ct(*pskb, proto,&set_reply,hooknum,&ctinfo))) {
/* Not valid part of a connection */
CONNTRACK_STAT_INC_ATOMIC(invalid);
CONNTRACK_STAT_INC(invalid);
return NF_ACCEPT;
}

if (IS_ERR(ct)) {
/* Too stressed to deal. */
CONNTRACK_STAT_INC_ATOMIC(drop);
CONNTRACK_STAT_INC(drop);
return NF_DROP;
}

Expand All @@ -868,7 +862,7 @@ unsigned int ip_conntrack_in(unsigned int hooknum,
* the netfilter core what to do*/
nf_conntrack_put((*pskb)->nfct);
(*pskb)->nfct = NULL;
CONNTRACK_STAT_INC_ATOMIC(invalid);
CONNTRACK_STAT_INC(invalid);
return -ret;
}

Expand All @@ -881,15 +875,8 @@ unsigned int ip_conntrack_in(unsigned int hooknum,
int invert_tuplepr(struct ip_conntrack_tuple *inverse,
const struct ip_conntrack_tuple *orig)
{
struct ip_conntrack_protocol *proto;
int ret;

rcu_read_lock();
proto = __ip_conntrack_proto_find(orig->dst.protonum);
ret = ip_ct_invert_tuple(inverse, orig, proto);
rcu_read_unlock();

return ret;
return ip_ct_invert_tuple(inverse, orig,
__ip_conntrack_proto_find(orig->dst.protonum));
}

/* Would two expected things clash? */
Expand Down Expand Up @@ -1367,7 +1354,7 @@ static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)
supposed to kill the mall. */
void ip_conntrack_cleanup(void)
{
rcu_assign_pointer(ip_ct_attach, NULL);
ip_ct_attach = NULL;

/* This makes sure all current packets have passed through
netfilter framework. Roll on, two-stage module
Expand Down Expand Up @@ -1520,15 +1507,15 @@ int __init ip_conntrack_init(void)
/* Don't NEED lock here, but good form anyway. */
write_lock_bh(&ip_conntrack_lock);
for (i = 0; i < MAX_IP_CT_PROTO; i++)
rcu_assign_pointer(ip_ct_protos[i], &ip_conntrack_generic_protocol);
ip_ct_protos[i] = &ip_conntrack_generic_protocol;
/* Sew in builtin protocols. */
rcu_assign_pointer(ip_ct_protos[IPPROTO_TCP], &ip_conntrack_protocol_tcp);
rcu_assign_pointer(ip_ct_protos[IPPROTO_UDP], &ip_conntrack_protocol_udp);
rcu_assign_pointer(ip_ct_protos[IPPROTO_ICMP], &ip_conntrack_protocol_icmp);
ip_ct_protos[IPPROTO_TCP] = &ip_conntrack_protocol_tcp;
ip_ct_protos[IPPROTO_UDP] = &ip_conntrack_protocol_udp;
ip_ct_protos[IPPROTO_ICMP] = &ip_conntrack_protocol_icmp;
write_unlock_bh(&ip_conntrack_lock);

/* For use by ipt_REJECT */
rcu_assign_pointer(ip_ct_attach, ip_conntrack_attach);
ip_ct_attach = ip_conntrack_attach;

/* Set up fake conntrack:
- to never be deleted, not in any hashes */
Expand Down
9 changes: 5 additions & 4 deletions trunk/net/ipv4/netfilter/ip_conntrack_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto)
ret = -EBUSY;
goto out;
}
rcu_assign_pointer(ip_ct_protos[proto->proto], proto);
ip_ct_protos[proto->proto] = proto;
out:
write_unlock_bh(&ip_conntrack_lock);
return ret;
Expand All @@ -805,10 +805,11 @@ int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto)
void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto)
{
write_lock_bh(&ip_conntrack_lock);
rcu_assign_pointer(ip_ct_protos[proto->proto],
&ip_conntrack_generic_protocol);
ip_ct_protos[proto->proto] = &ip_conntrack_generic_protocol;
write_unlock_bh(&ip_conntrack_lock);
synchronize_rcu();

/* Somebody could be still looking at the proto in bh. */
synchronize_net();

/* Remove all contrack entries for this protocol */
ip_ct_iterate_cleanup(kill_proto, &proto->proto);
Expand Down
Loading

0 comments on commit 092ac52

Please sign in to comment.