Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 409550 Details for
Bug 558234
net-firewall/iptables[static-libs]: missing connlabel.conf causes unnecessary error messages
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
iptables-missing-connlabel.conf-causes-unnecessary-error-messages.patch
iptables-missing-connlabel.conf-causes-unnecessary-error-messages.patch (text/plain), 1.40 KB, created by
Attila Tóth
on 2015-08-20 09:37:36 UTC
(
hide
)
Description:
iptables-missing-connlabel.conf-causes-unnecessary-error-messages.patch
Filename:
MIME Type:
Creator:
Attila Tóth
Created:
2015-08-20 09:37:36 UTC
Size:
1.40 KB
patch
obsolete
>diff --git a/extensions/libxt_connlabel.c b/extensions/libxt_connlabel.c >--- a/extensions/libxt_connlabel.c >+++ b/extensions/libxt_connlabel.c >@@ -29,11 +29,26 @@ static const struct xt_option_entry connlabel_mt_opts[] = { > XTOPT_TABLEEND, > }; > >+/* cannot do this via _init, else static builds might spew error message >+ * for every iptables invocation. >+ */ >+static void connlabel_open(void) >+{ >+ if (map) >+ return; >+ >+ map = nfct_labelmap_new(NULL); >+ if (!map && errno) >+ xtables_error(RESOURCE_PROBLEM, "cannot open connlabel.conf: %s\n", >+ strerror(errno)); >+} >+ > static void connlabel_mt_parse(struct xt_option_call *cb) > { > struct xt_connlabel_mtinfo *info = cb->data; > int tmp; > >+ connlabel_open(); > xtables_option_parse(cb); > > switch (cb->entry->id) { >@@ -54,7 +69,11 @@ static void connlabel_mt_parse(struct xt_option_call *cb) > > static const char *connlabel_get_name(int b) > { >- const char *name = nfct_labelmap_get_name(map, b); >+ const char *name; >+ >+ connlabel_open(); >+ >+ name = nfct_labelmap_get_name(map, b); > if (name && strcmp(name, "")) > return name; > return NULL; >@@ -114,11 +133,5 @@ static struct xtables_match connlabel_mt_reg = { > > void _init(void) > { >- map = nfct_labelmap_new(NULL); >- if (!map) { >- fprintf(stderr, "cannot open connlabel.conf, not registering '%s' match: %s\n", >- connlabel_mt_reg.name, strerror(errno)); >- return; >- } > xtables_register_match(&connlabel_mt_reg); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 558234
: 409550