Loading net/netfilter/nf_log.c +20 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,20 @@ int nf_logger_find_get(int pf, enum nf_log_type type) struct nf_logger *logger; int ret = -ENOENT; if (pf == NFPROTO_INET) { ret = nf_logger_find_get(NFPROTO_IPV4, type); if (ret < 0) return ret; ret = nf_logger_find_get(NFPROTO_IPV6, type); if (ret < 0) { nf_logger_put(NFPROTO_IPV4, type); return ret; } return 0; } if (rcu_access_pointer(loggers[pf][type]) == NULL) request_module("nf-logger-%u-%u", pf, type); Loading @@ -179,6 +193,12 @@ void nf_logger_put(int pf, enum nf_log_type type) { struct nf_logger *logger; if (pf == NFPROTO_INET) { nf_logger_put(NFPROTO_IPV4, type); nf_logger_put(NFPROTO_IPV6, type); return; } BUG_ON(loggers[pf][type] == NULL); rcu_read_lock(); Loading net/netfilter/nft_log.c +1 −20 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ static int nft_log_init(const struct nft_ctx *ctx, struct nft_log *priv = nft_expr_priv(expr); struct nf_loginfo *li = &priv->loginfo; const struct nlattr *nla; int ret; nla = tb[NFTA_LOG_PREFIX]; if (nla != NULL) { Loading Loading @@ -97,19 +96,6 @@ static int nft_log_init(const struct nft_ctx *ctx, break; } if (ctx->afi->family == NFPROTO_INET) { ret = nf_logger_find_get(NFPROTO_IPV4, li->type); if (ret < 0) return ret; ret = nf_logger_find_get(NFPROTO_IPV6, li->type); if (ret < 0) { nf_logger_put(NFPROTO_IPV4, li->type); return ret; } return 0; } return nf_logger_find_get(ctx->afi->family, li->type); } Loading @@ -122,13 +108,8 @@ static void nft_log_destroy(const struct nft_ctx *ctx, if (priv->prefix != nft_log_null_prefix) kfree(priv->prefix); if (ctx->afi->family == NFPROTO_INET) { nf_logger_put(NFPROTO_IPV4, li->type); nf_logger_put(NFPROTO_IPV6, li->type); } else { nf_logger_put(ctx->afi->family, li->type); } } static int nft_log_dump(struct sk_buff *skb, const struct nft_expr *expr) { Loading Loading
net/netfilter/nf_log.c +20 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,20 @@ int nf_logger_find_get(int pf, enum nf_log_type type) struct nf_logger *logger; int ret = -ENOENT; if (pf == NFPROTO_INET) { ret = nf_logger_find_get(NFPROTO_IPV4, type); if (ret < 0) return ret; ret = nf_logger_find_get(NFPROTO_IPV6, type); if (ret < 0) { nf_logger_put(NFPROTO_IPV4, type); return ret; } return 0; } if (rcu_access_pointer(loggers[pf][type]) == NULL) request_module("nf-logger-%u-%u", pf, type); Loading @@ -179,6 +193,12 @@ void nf_logger_put(int pf, enum nf_log_type type) { struct nf_logger *logger; if (pf == NFPROTO_INET) { nf_logger_put(NFPROTO_IPV4, type); nf_logger_put(NFPROTO_IPV6, type); return; } BUG_ON(loggers[pf][type] == NULL); rcu_read_lock(); Loading
net/netfilter/nft_log.c +1 −20 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ static int nft_log_init(const struct nft_ctx *ctx, struct nft_log *priv = nft_expr_priv(expr); struct nf_loginfo *li = &priv->loginfo; const struct nlattr *nla; int ret; nla = tb[NFTA_LOG_PREFIX]; if (nla != NULL) { Loading Loading @@ -97,19 +96,6 @@ static int nft_log_init(const struct nft_ctx *ctx, break; } if (ctx->afi->family == NFPROTO_INET) { ret = nf_logger_find_get(NFPROTO_IPV4, li->type); if (ret < 0) return ret; ret = nf_logger_find_get(NFPROTO_IPV6, li->type); if (ret < 0) { nf_logger_put(NFPROTO_IPV4, li->type); return ret; } return 0; } return nf_logger_find_get(ctx->afi->family, li->type); } Loading @@ -122,13 +108,8 @@ static void nft_log_destroy(const struct nft_ctx *ctx, if (priv->prefix != nft_log_null_prefix) kfree(priv->prefix); if (ctx->afi->family == NFPROTO_INET) { nf_logger_put(NFPROTO_IPV4, li->type); nf_logger_put(NFPROTO_IPV6, li->type); } else { nf_logger_put(ctx->afi->family, li->type); } } static int nft_log_dump(struct sk_buff *skb, const struct nft_expr *expr) { Loading