Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/netfilter/nft_reject_netdev.c |
static void nft_reject_queue_xmit(struct sk_buff *nskb,
struct sk_buff *oldskb) {
dev_hard_header(nskb, nskb->dev, ntohs(oldskb->protocol),
eth_hdr(oldskb)->h_source, eth_hdr(oldskb)->h_dest,
nskb->len);
dev_queue_xmit(nskb);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_reject_netdev.c |
static void nft_reject_netdev_send_v4_tcp_reset(struct net *net,
struct sk_buff *oldskb,
const struct net_device *dev,
int hook) {
struct sk_buff *nskb;
nskb = nf_reject_... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_reject_netdev.c |
static void nft_reject_netdev_send_v4_unreach(struct net *net,
struct sk_buff *oldskb,
const struct net_device *dev,
int hook, u8 code) {
struct sk_buff *nskb;
nskb = nf_reject... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_reject_netdev.c |
static void nft_reject_netdev_send_v6_tcp_reset(struct net *net,
struct sk_buff *oldskb,
const struct net_device *dev,
int hook) {
struct sk_buff *nskb;
nskb = nf_reject_... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_reject_netdev.c |
static void __exit nft_reject_netdev_module_exit(void) {
nft_unregister_expr(&nft_reject_netdev_type);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_rt.c |
static u16 get_tcpmss(const struct nft_pktinfo *pkt,
const struct dst_entry *skbdst) {
u32 minlen = sizeof(struct ipv6hdr), mtu = dst_mtu(skbdst);
const struct sk_buff *skb = pkt->skb;
struct dst_entry *dst = NULL;
struct flowi fl;
memset(&fl, 0, sizeof(fl));
switch (nft_pf(pkt)) {
... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_rt.c |
static int nft_rt_get_init(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nlattr *const tb[]) {
struct nft_rt *priv = nft_expr_priv(expr);
unsigned int len;
if (tb[NFTA_RT_KEY] == NULL || tb[NFTA_RT_DREG] == NULL)
return -EINVAL;
... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_bitmap.c | static inline bool nft_bitmap_active(const u8 *bitmap, u32 idx, u32 off,
u8 genmask) {
return (bitmap[idx] & (0x3 << off)) & (genmask << off);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_bitmap.c | static bool nft_bitmap_flush(const struct net *net, const struct nft_set *set,
void *_be) {
struct nft_bitmap *priv = nft_set_priv(set);
u8 genmask = nft_genmask_next(net);
struct nft_bitmap_elem *be = _be;
u32 idx, off;
nft_bitmap_location(set, nft_set_ext_key(&be->ext), &idx, &... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_bitmap.c | static inline u32 nft_bitmap_size(u32 klen) {
return ((2 << ((klen * BITS_PER_BYTE) - 1)) / BITS_PER_BYTE) << 1;
} | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_bitmap.c |
static u64 nft_bitmap_privsize(const struct nlattr *const nla[],
const struct nft_set_desc *desc) {
u32 klen = ntohl(nla_get_be32(nla[NFTA_SET_KEY_LEN]));
return nft_bitmap_total_size(klen);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_bitmap.c |
static void nft_bitmap_destroy(const struct nft_set *set) {
struct nft_bitmap *priv = nft_set_priv(set);
struct nft_bitmap_elem *be, *n;
list_for_each_entry_safe(be, n, &priv->list, head)
nft_set_elem_destroy(set, be, true);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static void nft_rhash_remove(const struct net *net, const struct nft_set *set,
const struct nft_set_elem *elem) {
struct nft_rhash *priv = nft_set_priv(set);
struct nft_rhash_elem *he = elem->priv;
rhashtable_remove_fast(&priv->ht, &he->node, nft_rhash_params);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static bool nft_rhash_delete(const struct nft_set *set, const u32 *key) {
struct nft_rhash *priv = nft_set_priv(set);
struct nft_rhash_cmp_arg arg = {
.genmask = NFT_GENMASK_ANY,
.set = set,
.key = key,
};
struct nft_rhash_elem *he;
he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params)... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static void nft_rhash_walk(const struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_iter *iter) {
struct nft_rhash *priv = nft_set_priv(set);
struct nft_rhash_elem *he;
struct rhashtable_iter hti;
struct nft_set_elem elem;
rhashtable_walk_enter(&priv->ht, &hti);
rhashtable... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static void nft_rhash_gc_init(const struct nft_set *set) {
struct nft_rhash *priv = nft_set_priv(set);
queue_delayed_work(system_power_efficient_wq, &priv->gc_work,
nft_set_gc_interval(set));
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static bool nft_rhash_estimate(const struct nft_set_desc *desc, u32 features,
struct nft_set_estimate *est) {
est->size = ~0;
est->lookup = NFT_SET_CLASS_O_1;
est->space = NFT_SET_CLASS_O_N;
return true;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
INDIRECT_CALLABLE_SCOPE
bool nft_hash_lookup_fast(const struct net *net, const struct nft_set *set,
const u32 *key, const struct nft_set_ext **ext) {
struct nft_hash *priv = nft_set_priv(set);
u8 genmask = nft_genmask_cur(net);
const struct nft_hash_elem *he;
u32 hash, k1, k2;
k1 =... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static void *nft_hash_deactivate(const struct net *net,
const struct nft_set *set,
const struct nft_set_elem *elem) {
struct nft_hash *priv = nft_set_priv(set);
struct nft_hash_elem *this = elem->priv, *he;
u8 genmask = nft_genmask_next(net);
u3... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static u64 nft_hash_privsize(const struct nlattr *const nla[],
const struct nft_set_desc *desc) {
return sizeof(struct nft_hash) +
(u64)nft_hash_buckets(desc->size) * sizeof(struct hlist_head);
} | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static bool nft_hash_estimate(const struct nft_set_desc *desc, u32 features,
struct nft_set_estimate *est) {
if (!desc->size)
return false;
if (desc->klen == 4)
return false;
est->size = sizeof(struct nft_hash) +
(u64)nft_hash_buckets(desc->size) * sizeof(str... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_hash.c |
static bool nft_hash_fast_estimate(const struct nft_set_desc *desc,
u32 features, struct nft_set_estimate *est) {
if (!desc->size)
return false;
if (desc->klen != 4)
return false;
est->size = sizeof(struct nft_hash) +
(u64)nft_hash_buckets(desc->size) * ... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_pipapo.c | static void pipapo_bucket_set(struct nft_pipapo_field *f, int rule, int group,
int v) {
unsigned long *pos;
pos = NFT_PIPAPO_LT_ALIGN(f->lt);
pos += f->bsize * NFT_PIPAPO_BUCKETS(f->bb) * group;
pos += f->bsize * v;
__set_bit(rule, pos);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_pipapo.c | static void pipapo_lt_bits_adjust(struct nft_pipapo_field *f) {
unsigned long *new_lt;
int groups, bb;
size_t lt_size;
lt_size = f->groups * NFT_PIPAPO_BUCKETS(f->bb) * f->bsize * sizeof(*f->lt);
if (f->bb == NFT_PIPAPO_GROUP_BITS_SMALL_SET &&
lt_size > NFT_PIPAPO_LT_SIZE_HIGH) {
groups = f->group... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_pipapo.h | static inline void pipapo_and_field_buckets_4bit(struct nft_pipapo_field *f,
unsigned long *dst,
const u8 *data) {
unsigned long *lt = NFT_PIPAPO_LT_ALIGN(f->lt);
int group;
for (group = 0; group < f->groups; group ... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_pipapo.h | static u64 pipapo_estimate_size(const struct nft_set_desc *desc) {
unsigned long entry_size;
u64 size;
int i;
for (i = 0, entry_size = 0; i < desc->field_count; i++) {
unsigned long rules;
if (desc->field_len[i] > NFT_PIPAPO_MAX_BYTES)
return 0;
rules = ilog2(desc->field_len[i] * BITS_PER_B... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_pipapo_avx2.c | static int nft_pipapo_avx2_refill(int offset, unsigned long *map,
unsigned long *dst,
union nft_pipapo_map_bucket *mt, bool last) {
int ret = -1;
#define NFT_PIPAPO_AVX2_REFILL_ONE_WORD(x) \
do { ... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_rbtree.c |
static bool nft_rbtree_interval_end(const struct nft_rbtree_elem *rbe) {
return nft_set_ext_exists(&rbe->ext, NFT_SET_EXT_FLAGS) &&
(*nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_rbtree.c |
INDIRECT_CALLABLE_SCOPE
bool nft_rbtree_lookup(const struct net *net, const struct nft_set *set,
const u32 *key, const struct nft_set_ext **ext) {
struct nft_rbtree *priv = nft_set_priv(set);
unsigned int seq = read_seqcount_begin(&priv->count);
bool ret;
ret = __nft_rbtree_lookup(net, ... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_set_rbtree.c |
static void nft_rbtree_activate(const struct net *net,
const struct nft_set *set,
const struct nft_set_elem *elem) {
struct nft_rbtree_elem *rbe = elem->priv;
nft_set_elem_change_active(net, set, &rbe->ext);
nft_set_elem_clear_busy(&rbe->ext);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_set_rbtree.c |
static u64 nft_rbtree_privsize(const struct nlattr *const nla[],
const struct nft_set_desc *desc) {
return sizeof(struct nft_rbtree);
} | [
1,
0
] |
Linux Kernel | net/netfilter/nft_socket.c |
static void nft_socket_wildcard(const struct nft_pktinfo *pkt,
struct nft_regs *regs, struct sock *sk,
u32 *dest) {
switch (nft_pf(pkt)) {
case NFPROTO_IPV4:
nft_reg_store8(dest, inet_sk(sk)->inet_rcv_saddr == 0);
break;
#if IS_ENABLED(CONFIG_... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_socket.c |
static struct sock *nft_socket_do_lookup(const struct nft_pktinfo *pkt) {
const struct net_device *indev = nft_in(pkt);
const struct sk_buff *skb = pkt->skb;
struct sock *sk = NULL;
if (!indev)
return NULL;
switch (nft_pf(pkt)) {
case NFPROTO_IPV4:
sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, ind... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_socket.c |
static int nft_socket_dump(struct sk_buff *skb, const struct nft_expr *expr,
bool reset) {
const struct nft_socket *priv = nft_expr_priv(expr);
if (nla_put_be32(skb, NFTA_SOCKET_KEY, htonl(priv->key)))
return -1;
if (nft_dump_register(skb, NFTA_SOCKET_DREG, priv->dreg))
return... | [
0,
0
] |
Linux Kernel | net/netfilter/nft_socket.c |
static bool nft_socket_reduce(struct nft_regs_track *track,
const struct nft_expr *expr) {
const struct nft_socket *priv = nft_expr_priv(expr);
const struct nft_socket *socket;
if (!nft_reg_track_cmp(track, expr, priv->dreg)) {
nft_reg_track_update(track, expr, priv->dreg, priv... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_socket.c |
static void __exit nft_socket_module_exit(void) {
nft_unregister_expr(&nft_socket_type);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_synproxy.c |
static void nft_synproxy_do_eval(const struct nft_synproxy *priv,
struct nft_regs *regs,
const struct nft_pktinfo *pkt) {
struct synproxy_options opts = {};
struct sk_buff *skb = pkt->skb;
int thoff = nft_thoff(pkt);
const struct tcphdr *tcp;
... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_synproxy.c |
static void nft_synproxy_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt) {
const struct nft_synproxy *priv = nft_expr_priv(expr);
nft_synproxy_do_eval(priv, regs, pkt);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_synproxy.c |
static void nft_synproxy_obj_destroy(const struct nft_ctx *ctx,
struct nft_object *obj) {
nft_synproxy_do_destroy(ctx);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_synproxy.c |
static void nft_synproxy_obj_update(struct nft_object *obj,
struct nft_object *newobj) {
struct nft_synproxy *newpriv = nft_obj_data(newobj);
struct nft_synproxy *priv = nft_obj_data(obj);
priv->info = newpriv->info;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_synproxy.c |
static int __init nft_synproxy_module_init(void) {
int err;
err = nft_register_obj(&nft_synproxy_obj_type);
if (err < 0)
return err;
err = nft_register_expr(&nft_synproxy_type);
if (err < 0)
goto err;
return 0;
err:
nft_unregister_obj(&nft_synproxy_obj_type);
return err;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nft_tproxy.c |
static void nft_tproxy_destroy(const struct nft_ctx *ctx,
const struct nft_expr *expr) {
const struct nft_tproxy *priv = nft_expr_priv(expr);
switch (priv->family) {
case NFPROTO_IPV4:
nf_defrag_ipv4_disable(ctx->net);
break;
#if IS_ENABLED(CONFIG_NF_TABLES_IPV6)
case NF... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_xfrm.c |
static int nft_xfrm_get_init(const struct nft_ctx *ctx,
const struct nft_expr *expr,
const struct nlattr *const tb[]) {
struct nft_xfrm *priv = nft_expr_priv(expr);
unsigned int len = 0;
u32 spnum = 0;
u8 dir;
if (!tb[NFTA_XFRM_KEY] || !tb[NFTA_XFRM_... | [
1,
0
] |
Linux Kernel | net/netfilter/nft_xfrm.c |
static void nft_xfrm_get_eval(const struct nft_expr *expr,
struct nft_regs *regs,
const struct nft_pktinfo *pkt) {
const struct nft_xfrm *priv = nft_expr_priv(expr);
switch (priv->dir) {
case XFRM_POLICY_IN:
nft_xfrm_get_eval_in(priv, regs, pkt);
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c |
static int key_diff(const u32 *a, const u32 *b, unsigned int klen) {
return memcmp(a, b, klen * sizeof(u32));
} | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c | int nf_conncount_add(struct net *net, struct nf_conncount_list *list,
const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_zone *zone) {
int ret;
spin_lock_bh(&list->list_lock);
ret = __nf_conncount_add(net, list, tuple, zone);
spin_unlock_bh(&list->list_l... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c |
static void schedule_gc_worker(struct nf_conncount_data *data, int tree) {
set_bit(tree, data->pending_trees);
schedule_work(&data->gc_work);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c | static void tree_gc_worker(struct work_struct *work) {
struct nf_conncount_data *data =
container_of(work, struct nf_conncount_data, gc_work);
struct nf_conncount_rb *gc_nodes[CONNCOUNT_GC_MAX_NODES], *rbconn;
struct rb_root *root;
struct rb_node *node;
unsigned int tree, next_tree, gc_count = 0;
tre... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c |
void nf_conncount_cache_free(struct nf_conncount_list *list) {
struct nf_conncount_tuple *conn, *conn_n;
list_for_each_entry_safe(conn, conn_n, &list->head, node)
kmem_cache_free(conncount_conn_cachep, conn);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conncount.c |
static int __init nf_conncount_modinit(void) {
int i;
for (i = 0; i < CONNCOUNT_SLOTS; ++i)
spin_lock_init(&nf_conncount_locks[i]);
conncount_conn_cachep = kmem_cache_create(
"nf_conncount_tuple", sizeof(struct nf_conncount_tuple), 0, 0, NULL);
if (!conncount_conn_cachep)
return -ENOMEM;
con... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_amanda.c |
static void __exit nf_conntrack_amanda_fini(void) {
int i;
nf_conntrack_helpers_unregister(amanda_helper, ARRAY_SIZE(amanda_helper));
for (i = 0; i < ARRAY_SIZE(search); i++)
textsearch_destroy(search[i].ts);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_amanda.c |
static int __init nf_conntrack_amanda_init(void) {
int ret, i;
NF_CT_HELPER_BUILD_BUG_ON(0);
for (i = 0; i < ARRAY_SIZE(search); i++) {
search[i].ts = textsearch_prepare(ts_algo, search[i].string, search[i].len,
GFP_KERNEL, TS_AUTOLOAD);
if (IS_ERR(search[i].ts)) {... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c |
static struct nf_conn *
__bpf_nf_ct_lookup(struct net *net, struct bpf_sock_tuple *bpf_tuple,
u32 tuple_len, struct bpf_ct_opts *opts, u32 opts_len) {
struct nf_conntrack_tuple_hash *hash;
struct nf_conntrack_tuple tuple;
struct nf_conn *ct;
int err;
if (!opts || !bpf_tuple || opts->reser... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c | static int _nf_conntrack_btf_struct_access(struct bpf_verifier_log *log,
const struct bpf_reg_state *reg,
int off, int size,
enum bpf_access_type atype,
... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c | struct nf_conn___init *bpf_skb_ct_alloc(struct __sk_buff *skb_ctx,
struct bpf_sock_tuple *bpf_tuple,
u32 tuple__sz, struct bpf_ct_opts *opts,
u32 opts__sz) {
struct sk_buff *skb = (struct sk_buff *)... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c | struct nf_conn *bpf_skb_ct_lookup(struct __sk_buff *skb_ctx,
struct bpf_sock_tuple *bpf_tuple,
u32 tuple__sz, struct bpf_ct_opts *opts,
u32 opts__sz) {
struct sk_buff *skb = (struct sk_buff *)skb_ctx;
struct net *c... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c | int bpf_ct_set_status(const struct nf_conn___init *nfct, u32 status) {
return nf_ct_change_status_common((struct nf_conn *)nfct, status);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_bpf.c | int bpf_ct_change_status(struct nf_conn *nfct, u32 status) {
return nf_ct_change_status_common(nfct, status);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
static void nf_conntrack_double_unlock(unsigned int h1, unsigned int h2) {
h1 %= CONNTRACK_LOCKS;
h2 %= CONNTRACK_LOCKS;
spin_unlock(&nf_conntrack_locks[h1]);
if (h1 != h2)
spin_unlock(&nf_conntrack_locks[h2]);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static bool nf_conntrack_double_lock(struct net *net, unsigned int h1,
unsigned int h2, unsigned int sequence) {
h1 %= CONNTRACK_LOCKS;
h2 %= CONNTRACK_LOCKS;
if (h1 <= h2) {
nf_conntrack_lock(&nf_conntrack_locks[h1]);
if (h1 != h2)
spin_lock_nested(&nf_conntrack... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
static u32 scale_hash(u32 hash) {
return reciprocal_scale(hash, nf_conntrack_htable_size);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
u_int16_t l3num, struct net *net,
struct nf_conntrack_tuple *tuple) {
u8 protonum;
int protoff;
protoff = get_l4proto(skb, nhoff, l3num, &protonum);
if (protoff <= 0)
return false;
return... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static void clean_from_lists(struct nf_conn *ct) {
pr_debug("clean_from_lists(%p)\n", ct);
hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode);
hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode);
nf_ct_remove_expectations(ct);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
static void __nf_ct_delete_from_lists(struct nf_conn *ct) {
struct net *net = nf_ct_net(ct);
unsigned int hash, reply_hash;
unsigned int sequence;
do {
sequence = read_seqcount_begin(&nf_conntrack_generation);
hash = hash_conntrack(net, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
static void nf_ct_add_to_ecache_list(struct nf_conn *ct) {
#ifdef CONFIG_NF_CONNTRACK_EVENTS
struct nf_conntrack_net *cnet = nf_ct_pernet(nf_ct_net(ct));
spin_lock(&cnet->ecache.dying_lock);
hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
&cnet->ecache.dying_list);... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c |
static void __nf_conntrack_hash_insert(struct nf_conn *ct, unsigned int hash,
unsigned int reply_hash) {
hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,
&nf_conntrack_hash[hash]);
hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static bool nf_ct_ext_valid_pre(const struct nf_ct_ext *ext) {
return !ext || ext->gen_id == atomic_read(&nf_conntrack_ext_genid);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static void nf_ct_acct_merge(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
const struct nf_conn *loser_ct) {
struct nf_conn_acct *acct;
acct = nf_conn_acct_find(loser_ct);
if (acct) {
struct nf_conn_counter *counter = acct->counter;
unsigned int bytes;
bytes = atomi... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static int nf_ct_resolve_clash_harder(struct sk_buff *skb, u32 repl_idx) {
struct nf_conn *loser_ct = (struct nf_conn *)skb_nfct(skb);
const struct nf_conntrack_zone *zone;
struct nf_conntrack_tuple_hash *h;
struct hlist_nulls_node *n;
struct net *net;
zone = nf_ct_zone(loser_ct);
net = nf_ct_net(loser_c... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static __cold noinline int
nf_ct_resolve_clash(struct sk_buff *skb, struct nf_conntrack_tuple_hash *h,
u32 reply_hash) {
struct nf_conn *ct = nf_ct_tuplehash_to_ctrack(h);
const struct nf_conntrack_l4proto *l4proto;
enum ip_conntrack_info ctinfo;
struct nf_conn *loser_ct;
struct net *net;... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static struct nf_conn *
__nf_conntrack_alloc(struct net *net, const struct nf_conntrack_zone *zone,
const struct nf_conntrack_tuple *orig,
const struct nf_conntrack_tuple *repl, gfp_t gfp,
u32 hash) {
struct nf_conntrack_net *cnet = nf_ct_pernet(net);
u... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | static void nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data),
const struct nf_ct_iter_data *iter_data) {
unsigned int bucket = 0;
struct nf_conn *ct;
might_sleep();
mutex_lock(&nf_conntrack_mutex);
while ((ct = get_next_corpse(iter, iter_data, &bucket)) != N... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | int nf_conntrack_hash_resize(unsigned int hashsize) {
int i, bucket;
unsigned int old_size;
struct hlist_nulls_head *hash, *old_hash;
struct nf_conntrack_tuple_hash *h;
struct nf_conn *ct;
if (!hashsize)
return -EINVAL;
hash = nf_ct_alloc_hashtable(&hashsize, 1);
if (!hash)
return -ENOMEM;
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_core.c | int nf_ct_change_status_common(struct nf_conn *ct, unsigned int status) {
unsigned long d;
d = ct->status ^ status;
if (d & (IPS_EXPECTED | IPS_CONFIRMED | IPS_DYING))
return -EBUSY;
if (d & IPS_SEEN_REPLY && !(status & IPS_SEEN_REPLY))
/* SEEN_REPLY bit can only be set */
return -EBUSY;
if (... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ecache.c |
struct nf_conntrack_net_ecache *nf_conn_pernet_ecache(const struct net *net) {
struct nf_conntrack_net *cnet = nf_ct_pernet(net);
return &cnet->ecache;
}
#if IS_MODULE(CONFIG_NF_CT_NETLINK) | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ecache.c | int nf_conntrack_eventmask_report(unsigned int events, struct nf_conn *ct,
u32 portid, int report) {
struct nf_conntrack_ecache *e;
struct nf_ct_event item;
unsigned int missed;
int ret;
if (!nf_ct_is_confirmed(ct))
return 0;
e = nf_ct_ecache_find(ct);
if (!e)
r... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ecache.c | void nf_ct_deliver_cached_events(struct nf_conn *ct) {
struct nf_conntrack_ecache *e;
struct nf_ct_event item;
unsigned int events;
if (!nf_ct_is_confirmed(ct) || nf_ct_is_dying(ct))
return;
e = nf_ct_ecache_find(ct);
if (e == NULL)
return;
events = xchg(&e->cache, 0);
item.ct = ct;
item.p... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ecache.c | void nf_conntrack_ecache_pernet_init(struct net *net) {
struct nf_conntrack_net *cnet = nf_ct_pernet(net);
net->ct.sysctl_events = nf_ct_events;
INIT_DELAYED_WORK(&cnet->ecache.dwork, ecache_work);
INIT_HLIST_NULLS_HEAD(&cnet->ecache.dying_list, DYING_NULLS_VAL);
spin_lock_init(&cnet->ecache.dying_lock);
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c |
static void nf_ct_expectation_timed_out(struct timer_list *t) {
struct nf_conntrack_expect *exp = from_timer(exp, t, timeout);
spin_lock_bh(&nf_conntrack_expect_lock);
nf_ct_unlink_expect(exp);
spin_unlock_bh(&nf_conntrack_expect_lock);
nf_ct_expect_put(exp);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c |
static bool nf_ct_exp_equal(const struct nf_conntrack_tuple *tuple,
const struct nf_conntrack_expect *i,
const struct nf_conntrack_zone *zone,
const struct net *net) {
return nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask) &&
... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c |
bool nf_ct_remove_expect(struct nf_conntrack_expect *exp) {
if (del_timer(&exp->timeout)) {
nf_ct_unlink_expect(exp);
nf_ct_expect_put(exp);
return true;
}
return false;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c | struct nf_conntrack_expect *
nf_ct_expect_find_get(struct net *net, const struct nf_conntrack_zone *zone,
const struct nf_conntrack_tuple *tuple) {
struct nf_conntrack_expect *i;
rcu_read_lock();
i = __nf_ct_expect_find(net, zone, tuple);
if (i && !refcount_inc_not_zero(&i->use))
i = ... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c | static void nf_ct_expect_insert(struct nf_conntrack_expect *exp) {
struct nf_conntrack_net *cnet;
struct nf_conn_help *master_help = nfct_help(exp->master);
struct nf_conntrack_helper *helper;
struct net *net = nf_ct_exp_net(exp);
unsigned int h = nf_ct_expect_dst_hash(net, &exp->tuple);
refcount_add(2, &e... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c | static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect,
unsigned int flags) {
const struct nf_conntrack_expect_policy *p;
struct nf_conntrack_expect *i;
struct nf_conntrack_net *cnet;
struct nf_conn *master = expect->master;
struct nf_conn_help *master... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c |
void nf_ct_expect_iterate_net(struct net *net,
bool (*iter)(struct nf_conntrack_expect *e,
void *data),
void *data, u32 portid, int report) {
struct nf_conntrack_expect *exp;
const struct hlist_node *next;
unsi... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c | static int exp_proc_init(struct net *net) {
#ifdef CONFIG_NF_CONNTRACK_PROCFS
struct proc_dir_entry *proc;
kuid_t root_uid;
kgid_t root_gid;
proc = proc_create_net("nf_conntrack_expect", 0440, net->proc_net,
&exp_seq_ops, sizeof(struct ct_expect_iter_state));
if (!proc)
return -E... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c | static void exp_proc_remove(struct net *net) {
#ifdef CONFIG_NF_CONNTRACK_PROCFS
remove_proc_entry("nf_conntrack_expect", net->proc_net);
#endif
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_expect.c |
int nf_conntrack_expect_pernet_init(struct net *net) {
return exp_proc_init(net);
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_extend.c | static __always_inline unsigned int total_extension_size(void) {
BUILD_BUG_ON(NF_CT_EXT_NUM > 10);
return sizeof(struct nf_ct_ext) + sizeof(struct nf_conn_help)
#if IS_ENABLED(CONFIG_NF_NAT)
+ sizeof(struct nf_conn_nat)
#endif
+ sizeof(struct nf_conn_seqadj) + sizeof(struct nf_conn_acct)
#ifdef ... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_extend.c |
void nf_ct_ext_bump_genid(void) {
unsigned int value = atomic_inc_return(&nf_conntrack_ext_genid);
if (value == UINT_MAX)
atomic_set(&nf_conntrack_ext_genid, 1);
msleep(HZ);
} | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c |
static int get_ipv6_addr(const char *src, size_t dlen, struct in6_addr *dst,
u_int8_t term) {
const char *end;
int ret = in6_pton(src, min_t(size_t, dlen, 0xffff), (u8 *)dst, term, &end);
if (ret > 0)
return (int)(end - src);
return 0;
} | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int try_rfc959(const char *data, size_t dlen,
struct nf_conntrack_man *cmd, char term,
unsigned int *offset) {
int length;
u_int32_t array[6];
length = try_number(data, dlen, array, 6, ',', term);
if (length == 0)
return 0;
cmd->u3.ip =
htonl((arr... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int try_rfc1123(const char *data, size_t dlen,
struct nf_conntrack_man *cmd, char term,
unsigned int *offset) {
int i;
for (i = 0; i < dlen; i++)
if (isdigit(data[i]))
break;
if (i == dlen)
return 0;
*offset += i;
return try_rfc959(data + i... | [
0,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int get_port(const char *data, int start, size_t dlen, char delim,
__be16 *port) {
u_int16_t tmp_port = 0;
int i;
for (i = start; i < dlen; i++) {
if (data[i] == delim) {
if (tmp_port == 0)
break;
*port = htons(tmp_port);
pr_debug("get_port: return %d\n",... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int try_eprt(const char *data, size_t dlen, struct nf_conntrack_man *cmd,
char term, unsigned int *offset) {
char delim;
int length;
if (dlen <= 3) {
pr_debug("EPRT: too short\n");
return 0;
}
delim = data[0];
if (isdigit(delim) || delim < 33 || delim > 126 || data[2] != ... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int try_epsv_response(const char *data, size_t dlen,
struct nf_conntrack_man *cmd, char term,
unsigned int *offset) {
char delim;
if (dlen <= 3)
return 0;
delim = data[0];
if (isdigit(delim) || delim < 33 || delim > 126 || data[1] != delim ||... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static void update_nl_seq(struct nf_conn *ct, u32 nl_seq,
struct nf_ct_ftp_master *info, int dir,
struct sk_buff *skb) {
unsigned int i, oldest;
for (i = 0; i < info->seq_aft_nl_num[dir]; i++) {
if (info->seq_aft_nl[dir][i] == nl_seq)
return;
}
if ... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_ftp.c | static int __init nf_conntrack_ftp_init(void) {
int i, ret = 0;
NF_CT_HELPER_BUILD_BUG_ON(sizeof(struct nf_ct_ftp_master));
if (ports_c == 0)
ports[ports_c++] = FTP_PORT;
/* FIXME should be configurable whether IPv4 and IPv6 FTP connections
are tracked or not - YK */
for (i = 0; i < ports_c;... | [
0,
1
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_asn1.c | static unsigned int get_bitmap(struct bitstr *bs, unsigned int b) {
unsigned int v, l, shift, bytes;
if (!b)
return 0;
l = bs->bit + b;
if (l < 8) {
v = (unsigned int)(*bs->cur) << (bs->bit + 24);
bs->bit = l;
} else if (l == 8) {
v = (unsigned int)(*bs->cur++) << (bs->bit + 24);
bs->bi... | [
1,
0
] |
Linux Kernel | net/netfilter/nf_conntrack_h323_asn1.c | static unsigned int get_uint(struct bitstr *bs, int b) {
unsigned int v = 0;
switch (b) {
case 4:
v |= *bs->cur++;
v <<= 8;
fallthrough;
case 3:
v |= *bs->cur++;
v <<= 8;
fallthrough;
case 2:
v |= *bs->cur++;
v <<= 8;
fallthrough;
case 1:
v |= *bs->cur++;
break;
... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.