|
@@ -120,7 +120,7 @@ static void ct_seq_stop(struct seq_file *s, void *v)
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_NF_CONNTRACK_SECMARK
|
|
#ifdef CONFIG_NF_CONNTRACK_SECMARK
|
|
-static int ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
|
|
|
|
|
|
+static void ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
u32 len;
|
|
u32 len;
|
|
@@ -128,22 +128,20 @@ static int ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
|
|
|
|
|
|
ret = security_secid_to_secctx(ct->secmark, &secctx, &len);
|
|
ret = security_secid_to_secctx(ct->secmark, &secctx, &len);
|
|
if (ret)
|
|
if (ret)
|
|
- return 0;
|
|
|
|
|
|
+ return;
|
|
|
|
|
|
- ret = seq_printf(s, "secctx=%s ", secctx);
|
|
|
|
|
|
+ seq_printf(s, "secctx=%s ", secctx);
|
|
|
|
|
|
security_release_secctx(secctx, len);
|
|
security_release_secctx(secctx, len);
|
|
- return ret;
|
|
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
-static inline int ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
|
|
|
|
|
|
+static inline void ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
|
|
{
|
|
{
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
|
|
#ifdef CONFIG_NF_CONNTRACK_TIMESTAMP
|
|
-static int ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
|
|
|
|
|
|
+static void ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
|
|
{
|
|
{
|
|
struct ct_iter_state *st = s->private;
|
|
struct ct_iter_state *st = s->private;
|
|
struct nf_conn_tstamp *tstamp;
|
|
struct nf_conn_tstamp *tstamp;
|
|
@@ -157,16 +155,15 @@ static int ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
|
|
else
|
|
else
|
|
delta_time = 0;
|
|
delta_time = 0;
|
|
|
|
|
|
- return seq_printf(s, "delta-time=%llu ",
|
|
|
|
- (unsigned long long)delta_time);
|
|
|
|
|
|
+ seq_printf(s, "delta-time=%llu ",
|
|
|
|
+ (unsigned long long)delta_time);
|
|
}
|
|
}
|
|
- return 0;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
-static inline int
|
|
|
|
|
|
+static inline void
|
|
ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
|
|
ct_show_delta_time(struct seq_file *s, const struct nf_conn *ct)
|
|
{
|
|
{
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -193,12 +190,11 @@ static int ct_seq_show(struct seq_file *s, void *v)
|
|
NF_CT_ASSERT(l4proto);
|
|
NF_CT_ASSERT(l4proto);
|
|
|
|
|
|
ret = -ENOSPC;
|
|
ret = -ENOSPC;
|
|
- if (seq_printf(s, "%-8s %u %-8s %u %ld ",
|
|
|
|
- l3proto->name, nf_ct_l3num(ct),
|
|
|
|
- l4proto->name, nf_ct_protonum(ct),
|
|
|
|
- timer_pending(&ct->timeout)
|
|
|
|
- ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0)
|
|
|
|
- goto release;
|
|
|
|
|
|
+ seq_printf(s, "%-8s %u %-8s %u %ld ",
|
|
|
|
+ l3proto->name, nf_ct_l3num(ct),
|
|
|
|
+ l4proto->name, nf_ct_protonum(ct),
|
|
|
|
+ timer_pending(&ct->timeout)
|
|
|
|
+ ? (long)(ct->timeout.expires - jiffies)/HZ : 0);
|
|
|
|
|
|
if (l4proto->print_conntrack)
|
|
if (l4proto->print_conntrack)
|
|
l4proto->print_conntrack(s, ct);
|
|
l4proto->print_conntrack(s, ct);
|
|
@@ -206,12 +202,14 @@ static int ct_seq_show(struct seq_file *s, void *v)
|
|
print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
|
|
print_tuple(s, &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,
|
|
l3proto, l4proto);
|
|
l3proto, l4proto);
|
|
|
|
|
|
|
|
+ if (seq_has_overflowed(s))
|
|
|
|
+ goto release;
|
|
|
|
+
|
|
if (seq_print_acct(s, ct, IP_CT_DIR_ORIGINAL))
|
|
if (seq_print_acct(s, ct, IP_CT_DIR_ORIGINAL))
|
|
goto release;
|
|
goto release;
|
|
|
|
|
|
if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
|
|
if (!(test_bit(IPS_SEEN_REPLY_BIT, &ct->status)))
|
|
- if (seq_printf(s, "[UNREPLIED] "))
|
|
|
|
- goto release;
|
|
|
|
|
|
+ seq_printf(s, "[UNREPLIED] ");
|
|
|
|
|
|
print_tuple(s, &ct->tuplehash[IP_CT_DIR_REPLY].tuple,
|
|
print_tuple(s, &ct->tuplehash[IP_CT_DIR_REPLY].tuple,
|
|
l3proto, l4proto);
|
|
l3proto, l4proto);
|
|
@@ -220,26 +218,26 @@ static int ct_seq_show(struct seq_file *s, void *v)
|
|
goto release;
|
|
goto release;
|
|
|
|
|
|
if (test_bit(IPS_ASSURED_BIT, &ct->status))
|
|
if (test_bit(IPS_ASSURED_BIT, &ct->status))
|
|
- if (seq_printf(s, "[ASSURED] "))
|
|
|
|
- goto release;
|
|
|
|
|
|
+ seq_printf(s, "[ASSURED] ");
|
|
|
|
|
|
-#if defined(CONFIG_NF_CONNTRACK_MARK)
|
|
|
|
- if (seq_printf(s, "mark=%u ", ct->mark))
|
|
|
|
|
|
+ if (seq_has_overflowed(s))
|
|
goto release;
|
|
goto release;
|
|
|
|
+
|
|
|
|
+#if defined(CONFIG_NF_CONNTRACK_MARK)
|
|
|
|
+ seq_printf(s, "mark=%u ", ct->mark);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- if (ct_show_secctx(s, ct))
|
|
|
|
- goto release;
|
|
|
|
|
|
+ ct_show_secctx(s, ct);
|
|
|
|
|
|
#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
#ifdef CONFIG_NF_CONNTRACK_ZONES
|
|
- if (seq_printf(s, "zone=%u ", nf_ct_zone(ct)))
|
|
|
|
- goto release;
|
|
|
|
|
|
+ seq_printf(s, "zone=%u ", nf_ct_zone(ct));
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- if (ct_show_delta_time(s, ct))
|
|
|
|
- goto release;
|
|
|
|
|
|
+ ct_show_delta_time(s, ct);
|
|
|
|
+
|
|
|
|
+ seq_printf(s, "use=%u\n", atomic_read(&ct->ct_general.use));
|
|
|
|
|
|
- if (seq_printf(s, "use=%u\n", atomic_read(&ct->ct_general.use)))
|
|
|
|
|
|
+ if (seq_has_overflowed(s))
|
|
goto release;
|
|
goto release;
|
|
|
|
|
|
ret = 0;
|
|
ret = 0;
|