--- zzzz-none-000/linux-3.10.107/net/netfilter/nf_conntrack_core.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/net/netfilter/nf_conntrack_core.c 2021-11-10 11:53:56.000000000 +0000 @@ -12,6 +12,12 @@ * published by the Free Software Foundation. */ +/** + * Some part of this file is modified by Ikanos Communications. + * + * Copyright (C) 2013-2014 Ikanos Communications. + */ + #include #include #include @@ -53,6 +59,13 @@ #define NF_CONNTRACK_VERSION "0.5.0" +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +void (*ap2apRouteFlowDelete_ptr)(void *) = NULL; +#endif +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_BWMON_STATS) +void (*bwmonDeleteConntrackDevId_ptr)(void *) = NULL; +EXPORT_SYMBOL(bwmonDeleteConntrackDevId_ptr); +#endif int (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, enum nf_nat_manip_type manip, const struct nlattr *attr) __read_mostly; @@ -69,6 +82,11 @@ unsigned int nf_conntrack_htable_size __read_mostly; EXPORT_SYMBOL_GPL(nf_conntrack_htable_size); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +unsigned int *nf_ct_table_size = &nf_conntrack_htable_size; + +EXPORT_SYMBOL(nf_ct_table_size); +#endif unsigned int nf_conntrack_max __read_mostly; EXPORT_SYMBOL_GPL(nf_conntrack_max); @@ -207,6 +225,20 @@ NF_CT_ASSERT(atomic_read(&nfct->use) == 0); NF_CT_ASSERT(!timer_pending(&ct->timeout)); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) + if(ap2apRouteFlowDelete_ptr != NULL) + (*ap2apRouteFlowDelete_ptr)(ct); + else + printk("\n%s: ap2ap_lkm not initialized properly\n",__FUNCTION__); +#endif +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_BWMON_STATS) + /* This ptr/hook is initialized by bandwidth monitoring module. This hook + decrements usecount of device.Use count of device is incremented when + a new connection is originated/used by that device. + */ + if(bwmonDeleteConntrackDevId_ptr != NULL) + (*bwmonDeleteConntrackDevId_ptr)(ct); +#endif /* To make sure we don't get any weird locking issues here: * destroy_conntrack() MUST NOT be called with a write lock * to nf_conntrack_lock!!! -HW */ @@ -725,6 +757,9 @@ memset(&ct->tuplehash[IP_CT_DIR_MAX], 0, offsetof(struct nf_conn, proto) - offsetof(struct nf_conn, tuplehash[IP_CT_DIR_MAX])); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) + memset((void *)&ct->ct_general, 0 , sizeof(struct nf_conntrack)); +#endif spin_lock_init(&ct->lock); ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode.pprev = NULL; @@ -1709,3 +1744,6 @@ enum ip_conntrack_dir dir, u32 seq); EXPORT_SYMBOL_GPL(nf_ct_nat_offset); +#if IS_ENABLED(CONFIG_FUSIV_KERNEL_AP_2_AP) +EXPORT_SYMBOL(ap2apRouteFlowDelete_ptr); +#endif