Move EXPORT_SYMBOL() to the place where the symbol is defined. Signed-off-by: Martin Josefsson --- net/netfilter/nf_conntrack_core.c | 27 +++++++++++++ net/netfilter/nf_conntrack_ecache.c | 7 +++ net/netfilter/nf_conntrack_expect.c | 10 +++++ net/netfilter/nf_conntrack_helper.c | 4 ++ net/netfilter/nf_conntrack_proto.c | 11 +++++ net/netfilter/nf_conntrack_proto_tcp.c | 1 net/netfilter/nf_conntrack_standalone.c | 62 +------------------------------- 7 files changed, 62 insertions(+), 60 deletions(-) Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_core.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_core.c 2006-11-02 19:16:05.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_core.c 2006-11-02 19:18:14.000000000 +0100 @@ -64,15 +64,24 @@ #endif DEFINE_SPINLOCK(nf_conntrack_lock); +EXPORT_SYMBOL(nf_conntrack_lock); /* nf_conntrack_standalone needs this */ atomic_t nf_conntrack_count = ATOMIC_INIT(0); void (*nf_conntrack_destroyed)(struct nf_conn *conntrack) = NULL; +EXPORT_SYMBOL(nf_conntrack_destroyed); + unsigned int nf_conntrack_htable_size __read_mostly; +EXPORT_SYMBOL(nf_conntrack_htable_size); + int nf_conntrack_max __read_mostly; struct list_head *nf_conntrack_hash __read_mostly; +EXPORT_SYMBOL(nf_conntrack_hash); + struct nf_conn nf_conntrack_untracked __read_mostly; +EXPORT_SYMBOL(nf_conntrack_untracked); + unsigned int nf_ct_log_invalid __read_mostly; LIST_HEAD(unconfirmed); static int nf_conntrack_vmalloc __read_mostly; @@ -270,6 +279,7 @@ nf_ct_get_tuple(const struct sk_buff *sk return l4proto->pkt_to_tuple(skb, dataoff, tuple); } +EXPORT_SYMBOL(nf_ct_get_tuple); int nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, @@ -291,6 +301,7 @@ nf_ct_invert_tuple(struct nf_conntrack_t inverse->dst.protonum = orig->dst.protonum; return l4proto->invert_tuple(inverse, orig); } +EXPORT_SYMBOL(nf_ct_invert_tuple); static void clean_from_lists(struct nf_conn *ct, struct list_head *new_list) @@ -404,6 +415,7 @@ __nf_conntrack_find(const struct nf_conn return NULL; } +EXPORT_SYMBOL(__nf_conntrack_find); /* Find a connection corresponding to a tuple. */ struct nf_conntrack_tuple_hash * @@ -420,6 +432,7 @@ nf_conntrack_find_get(const struct nf_co return h; } +EXPORT_SYMBOL_GPL(nf_conntrack_find_get); static void __nf_conntrack_hash_insert(struct nf_conn *ct, unsigned int hash, @@ -443,6 +456,7 @@ void nf_conntrack_hash_insert(struct nf_ __nf_conntrack_hash_insert(ct, hash, repl_hash); spin_unlock_bh(&nf_conntrack_lock); } +EXPORT_SYMBOL(nf_conntrack_hash_insert); /* Confirm a connection given skb; places it in hash table */ int @@ -526,6 +540,7 @@ out: spin_unlock_bh(&nf_conntrack_lock); return NF_DROP; } +EXPORT_SYMBOL(__nf_conntrack_confirm); /* Returns true if a connection correspondings to the tuple (required for NAT). */ @@ -541,6 +556,7 @@ nf_conntrack_tuple_taken(const struct nf return h != NULL; } +EXPORT_SYMBOL(nf_conntrack_tuple_taken); /* There's a small race here where we may free a just-assured connection. Too bad: we're in trouble anyway. */ @@ -677,6 +693,7 @@ struct nf_conn *nf_conntrack_alloc(const return __nf_conntrack_alloc(orig, repl, l3proto, l4proto); } +EXPORT_SYMBOL(nf_conntrack_alloc); void nf_conntrack_free(struct nf_conn *conntrack) { @@ -687,6 +704,7 @@ void nf_conntrack_free(struct nf_conn *c kmem_cache_free(nf_ct_cache[features].cachep, conntrack); atomic_dec(&nf_conntrack_count); } +EXPORT_SYMBOL(nf_conntrack_free); /* Allocate a new conntrack: we return -ENOMEM if classification failed due to stress. Otherwise it really is unclassifiable. */ @@ -883,6 +901,7 @@ nf_conntrack_in(int pf, unsigned int hoo return ret; } +EXPORT_SYMBOL(nf_conntrack_in); int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, const struct nf_conntrack_tuple *orig) @@ -900,6 +919,7 @@ int nf_ct_invert_tuplepr(struct nf_connt return ret; } +EXPORT_SYMBOL(nf_ct_invert_tuplepr); /* Refresh conntrack for this many jiffies and do accounting if do_acct is 1 */ void __nf_ct_refresh_acct(struct nf_conn *ct, @@ -955,6 +975,7 @@ void __nf_ct_refresh_acct(struct nf_conn if (event) nf_conntrack_event_cache(event, ct); } +EXPORT_SYMBOL(__nf_ct_refresh_acct); #if defined(CONFIG_NF_CT_NETLINK) || \ defined(CONFIG_NF_CT_NETLINK_MODULE) @@ -979,6 +1000,7 @@ int nf_ct_port_tuple_to_nfattr(struct sk nfattr_failure: return -1; } +EXPORT_SYMBOL(nf_ct_port_tuple_to_nfattr); static const size_t cta_min_proto[CTA_PROTO_MAX] = { [CTA_PROTO_SRC_PORT-1] = sizeof(u_int16_t), @@ -1001,6 +1023,7 @@ int nf_ct_port_nfattr_to_tuple(struct nf return 0; } +EXPORT_SYMBOL(nf_ct_port_nfattr_to_tuple); #endif /* Used by ipt_REJECT and ip6t_REJECT. */ @@ -1021,6 +1044,7 @@ void __nf_conntrack_attach(struct sk_buf nskb->nfctinfo = ctinfo; nf_conntrack_get(nskb->nfct); } +EXPORT_SYMBOL(__nf_conntrack_attach); /* Bring out ya dead! */ struct nf_conn * @@ -1102,6 +1126,7 @@ i_see_dead_people: } spin_unlock_bh(&nf_conntrack_lock); } +EXPORT_SYMBOL(nf_ct_iterate_cleanup); static int kill_all(struct nf_conn *i, void *data) { @@ -1121,6 +1146,7 @@ void nf_conntrack_flush() { nf_ct_iterate_cleanup(kill_all, NULL); } +EXPORT_SYMBOL(nf_conntrack_flush); /* Mishearing the voices in his head, our hero wonders how he's supposed to kill the mall. */ @@ -1312,3 +1338,4 @@ err_free_hash: err_out: return -ENOMEM; } + Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_ecache.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_ecache.c 2006-11-02 19:14:45.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_ecache.c 2006-11-02 19:16:20.000000000 +0100 @@ -31,26 +31,31 @@ ATOMIC_NOTIFIER_HEAD(nf_conntrack_chain) ATOMIC_NOTIFIER_HEAD(nf_conntrack_expect_chain); DEFINE_PER_CPU(struct nf_conntrack_ecache, nf_conntrack_ecache); +EXPORT_PER_CPU_SYMBOL_GPL(nf_conntrack_ecache); int nf_conntrack_register_notifier(struct notifier_block *nb) { return atomic_notifier_chain_register(&nf_conntrack_chain, nb); } +EXPORT_SYMBOL_GPL(nf_conntrack_register_notifier); int nf_conntrack_unregister_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&nf_conntrack_chain, nb); } +EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); int nf_conntrack_expect_register_notifier(struct notifier_block *nb) { return atomic_notifier_chain_register(&nf_conntrack_expect_chain, nb); } +EXPORT_SYMBOL_GPL(nf_conntrack_expect_register_notifier); int nf_conntrack_expect_unregister_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&nf_conntrack_expect_chain, nb); } +EXPORT_SYMBOL_GPL(nf_conntrack_expect_unregister_notifier); /* deliver cached events and clear cache entry */ void nf_ct_deliver_cached_events(struct nf_conn *ct, unsigned int force) @@ -72,10 +77,12 @@ void nf_ct_deliver_cached_events(struct ecache->events = 0; } } +EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); void nf_conntrack_expect_event(enum ip_conntrack_expect_events event, struct nf_conntrack_expect *exp) { atomic_notifier_call_chain(&nf_conntrack_expect_chain, event, exp); } +EXPORT_SYMBOL_GPL(nf_conntrack_expect_event); Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_expect.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_expect.c 2006-11-02 19:16:05.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_expect.c 2006-11-02 19:16:20.000000000 +0100 @@ -27,6 +27,8 @@ #include LIST_HEAD(nf_conntrack_expect_list); +EXPORT_SYMBOL(nf_conntrack_expect_list); + kmem_cache_t *nf_conntrack_expect_cachep __read_mostly; DECLARE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); static unsigned int nf_conntrack_expect_next_id; @@ -44,6 +46,7 @@ void nf_ct_unlink_expect(struct nf_connt master_help->expecting--; nf_conntrack_expect_put(exp); } +EXPORT_SYMBOL(nf_ct_unlink_expect); static void expectation_timed_out(unsigned long ul_expect) { @@ -68,6 +71,7 @@ __nf_conntrack_expect_find(const struct } return NULL; } +EXPORT_SYMBOL(__nf_conntrack_expect_find); /* Just find a expectation corresponding to a tuple. */ struct nf_conntrack_expect * @@ -81,6 +85,7 @@ nf_conntrack_expect_find(const struct nf return i; } +EXPORT_SYMBOL(nf_conntrack_expect_find); /* If an expectation for this connection is found, it gets delete from * global list then returned. */ @@ -126,6 +131,7 @@ void nf_ct_remove_expectations(struct nf } } } +EXPORT_SYMBOL(nf_ct_remove_expectations); /* Would two expected things clash? */ static inline int expect_clash(const struct nf_conntrack_expect *a, @@ -180,6 +186,7 @@ void nf_conntrack_unexpect_related(struc } spin_unlock_bh(&nf_conntrack_lock); } +EXPORT_SYMBOL(nf_conntrack_unexpect_related); /* We don't increase the master conntrack refcount for non-fulfilled * conntracks. During the conntrack destruction, the expectations are @@ -196,12 +203,14 @@ struct nf_conntrack_expect *nf_conntrack atomic_set(&new->use, 1); return new; } +EXPORT_SYMBOL(nf_conntrack_expect_alloc); void nf_conntrack_expect_put(struct nf_conntrack_expect *exp) { if (atomic_dec_and_test(&exp->use)) kmem_cache_free(nf_conntrack_expect_cachep, exp); } +EXPORT_SYMBOL(nf_conntrack_expect_put); static void nf_conntrack_expect_insert(struct nf_conntrack_expect *exp) { @@ -282,6 +291,7 @@ out: spin_unlock_bh(&nf_conntrack_lock); return ret; } +EXPORT_SYMBOL(nf_conntrack_expect_related); #ifdef CONFIG_PROC_FS static void *exp_seq_start(struct seq_file *s, loff_t *pos) Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_helper.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_helper.c 2006-11-02 19:15:54.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_helper.c 2006-11-02 19:16:20.000000000 +0100 @@ -44,6 +44,7 @@ nf_ct_helper_find(const struct nf_conntr } return NULL; } +EXPORT_SYMBOL(nf_ct_helper_find); /* Must hold rcu_read_lock() when calling this function */ struct nf_conntrack_helper * @@ -57,6 +58,7 @@ nf_conntrack_helper_find_byname(const ch return NULL; } +EXPORT_SYMBOL(nf_conntrack_helper_find_byname); static int helper_match(struct nf_conn *i, void *data) { @@ -86,6 +88,7 @@ int nf_conntrack_helper_register(struct return 0; } +EXPORT_SYMBOL(nf_conntrack_helper_register); void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) { @@ -130,4 +133,5 @@ void nf_conntrack_helper_unregister(stru /* Someone could be still looking at the helper in a bh. */ synchronize_net(); } +EXPORT_SYMBOL(nf_conntrack_helper_unregister); Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_proto.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_proto.c 2006-11-02 19:15:47.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_proto.c 2006-11-02 19:16:20.000000000 +0100 @@ -28,7 +28,10 @@ #include struct nf_conntrack_l4proto **nf_ct_protos[PF_MAX] __read_mostly; +EXPORT_SYMBOL(nf_ct_protos); + struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX] __read_mostly; +EXPORT_SYMBOL(nf_ct_l3protos); /* Must hold rcu_read_lock() when calling this function. This is guaranteed to always return a valid protocol helper, since it falls back to @@ -51,6 +54,7 @@ nf_ct_l4proto_find(u_int16_t l3proto, u_ out: return l4p; } +EXPORT_SYMBOL(nf_ct_l4proto_find); /* Must hold rcu_read_lock() when calling this function */ struct nf_conntrack_l3proto * @@ -66,6 +70,7 @@ nf_ct_l3proto_find(u_int16_t l3proto) out: return p; } +EXPORT_SYMBOL(nf_ct_l3proto_find); int nf_ct_l3proto_try_module_get(unsigned short l3proto) @@ -84,6 +89,7 @@ retry: p = nf_ct_l3proto_find(l3proto); return 0; } +EXPORT_SYMBOL(nf_ct_l3proto_try_module_get); static int kill_l3proto(struct nf_conn *i, void *data) { @@ -123,6 +129,7 @@ out_unlock: out: return ret; } +EXPORT_SYMBOL(nf_conntrack_l3proto_register); int nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto) { @@ -153,6 +160,7 @@ int nf_conntrack_l3proto_unregister(stru out: return ret; } +EXPORT_SYMBOL(nf_conntrack_l3proto_unregister); /* FIXME: Allow NULL functions and sub in pointers to generic for them. --RR */ @@ -218,6 +226,7 @@ out_unlock: out: return ret; } +EXPORT_SYMBOL(nf_conntrack_l4proto_register); int nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *l4proto) { @@ -248,3 +257,5 @@ int nf_conntrack_l4proto_unregister(stru out: return ret; } +EXPORT_SYMBOL(nf_conntrack_l4proto_unregister); + Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_proto_tcp.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_proto_tcp.c 2006-11-02 19:14:44.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_proto_tcp.c 2006-11-02 19:16:20.000000000 +0100 @@ -764,6 +764,7 @@ void nf_conntrack_tcp_update(struct sk_b receiver->td_end, receiver->td_maxend, receiver->td_maxwin, receiver->td_scale); } +EXPORT_SYMBOL(nf_conntrack_tcp_update); #endif Index: linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_standalone.c =================================================================== --- linux-2.6.19-rc3-git4.quilt.orig/net/netfilter/nf_conntrack_standalone.c 2006-11-02 19:15:54.000000000 +0100 +++ linux-2.6.19-rc3-git4.quilt/net/netfilter/nf_conntrack_standalone.c 2006-11-02 19:16:20.000000000 +0100 @@ -377,6 +377,7 @@ static struct file_operations ct_cpu_seq /* Sysctl support */ int nf_conntrack_checksum __read_mostly = 1; +EXPORT_SYMBOL_GPL(nf_conntrack_checksum); #ifdef CONFIG_SYSCTL @@ -690,64 +691,5 @@ module_exit(nf_conntrack_standalone_fini void need_conntrack(void) { } - -#ifdef CONFIG_NF_CONNTRACK_EVENTS -EXPORT_SYMBOL_GPL(nf_conntrack_register_notifier); -EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); -EXPORT_SYMBOL_GPL(nf_conntrack_expect_register_notifier); -EXPORT_SYMBOL_GPL(nf_conntrack_expect_unregister_notifier); -EXPORT_PER_CPU_SYMBOL_GPL(nf_conntrack_ecache); -EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); -#endif -EXPORT_SYMBOL(nf_ct_l3proto_try_module_get); -EXPORT_SYMBOL(nf_conntrack_l3proto_register); -EXPORT_SYMBOL(nf_conntrack_l3proto_unregister); -EXPORT_SYMBOL(nf_conntrack_l4proto_register); -EXPORT_SYMBOL(nf_conntrack_l4proto_unregister); -EXPORT_SYMBOL(nf_ct_invert_tuplepr); -EXPORT_SYMBOL(nf_conntrack_destroyed); EXPORT_SYMBOL(need_conntrack); -EXPORT_SYMBOL(nf_conntrack_helper_register); -EXPORT_SYMBOL(nf_conntrack_helper_unregister); -EXPORT_SYMBOL(nf_ct_iterate_cleanup); -EXPORT_SYMBOL(__nf_ct_refresh_acct); -EXPORT_SYMBOL(nf_ct_protos); -EXPORT_SYMBOL(nf_ct_l4proto_find); -EXPORT_SYMBOL(nf_ct_l3proto_find); -EXPORT_SYMBOL(nf_ct_l3protos); -EXPORT_SYMBOL_GPL(nf_conntrack_checksum); -EXPORT_SYMBOL(nf_conntrack_expect_alloc); -EXPORT_SYMBOL(nf_conntrack_expect_put); -EXPORT_SYMBOL(nf_conntrack_expect_related); -EXPORT_SYMBOL(nf_conntrack_unexpect_related); -EXPORT_SYMBOL(nf_conntrack_tuple_taken); -EXPORT_SYMBOL(nf_conntrack_htable_size); -EXPORT_SYMBOL(nf_conntrack_lock); -EXPORT_SYMBOL(nf_conntrack_hash); -EXPORT_SYMBOL(nf_conntrack_untracked); -EXPORT_SYMBOL_GPL(nf_conntrack_find_get); -#ifdef CONFIG_IP_NF_NAT_NEEDED -EXPORT_SYMBOL(nf_conntrack_tcp_update); -#endif -EXPORT_SYMBOL(__nf_conntrack_confirm); -EXPORT_SYMBOL(nf_ct_get_tuple); -EXPORT_SYMBOL(nf_ct_invert_tuple); -EXPORT_SYMBOL(nf_conntrack_in); -EXPORT_SYMBOL(__nf_conntrack_attach); -EXPORT_SYMBOL(nf_conntrack_alloc); -EXPORT_SYMBOL(nf_conntrack_free); -EXPORT_SYMBOL(nf_conntrack_flush); -EXPORT_SYMBOL(nf_ct_remove_expectations); -EXPORT_SYMBOL(nf_ct_helper_find); -EXPORT_SYMBOL(nf_conntrack_helper_find_byname); -EXPORT_SYMBOL(__nf_conntrack_find); -EXPORT_SYMBOL(nf_ct_unlink_expect); -EXPORT_SYMBOL(nf_conntrack_hash_insert); -EXPORT_SYMBOL(__nf_conntrack_expect_find); -EXPORT_SYMBOL(nf_conntrack_expect_find); -EXPORT_SYMBOL(nf_conntrack_expect_list); -#if defined(CONFIG_NF_CT_NETLINK) || \ - defined(CONFIG_NF_CT_NETLINK_MODULE) -EXPORT_SYMBOL(nf_ct_port_tuple_to_nfattr); -EXPORT_SYMBOL(nf_ct_port_nfattr_to_tuple); -#endif +