iptables: fix regression with unintended free in need_protomatch
[project/firewall3.git] / options.c
index aed0cfb8a441dcd44ca9c478add57aa49bed20cd..2f419a3a9b45b63e88f1a739050fe3ba82841967 100644 (file)
--- a/options.c
+++ b/options.c
@@ -146,6 +146,7 @@ static const struct { const char *name; uint8_t dscp; } dscp_classes[] = {
        { "CS6",  0x30 },
        { "CS7",  0x38 },
        { "BE",   0x00 },
+       { "LE",   0x01 },
        { "AF11", 0x0a },
        { "AF12", 0x0c },
        { "AF13", 0x0e },
@@ -1170,6 +1171,9 @@ fw3_parse_blob_options(void *s, const struct fw3_option *opts,
                                                if (blobmsg_type(e) == BLOBMSG_TYPE_INT32) {
                                                        snprintf(buf, sizeof(buf), "%d", blobmsg_get_u32(e));
                                                        v = buf;
+                                               } else if (blobmsg_type(o) == BLOBMSG_TYPE_BOOL) {
+                                                       snprintf(buf, sizeof(buf), "%d", blobmsg_get_bool(o));
+                                                       v = buf;
                                                } else {
                                                        v = blobmsg_get_string(e);
                                                }
@@ -1189,6 +1193,9 @@ fw3_parse_blob_options(void *s, const struct fw3_option *opts,
                                if (blobmsg_type(o) == BLOBMSG_TYPE_INT32) {
                                        snprintf(buf, sizeof(buf), "%d", blobmsg_get_u32(o));
                                        v = buf;
+                               } else if (blobmsg_type(o) == BLOBMSG_TYPE_BOOL) {
+                                       snprintf(buf, sizeof(buf), "%d", blobmsg_get_bool(o));
+                                       v = buf;
                                } else {
                                        v = blobmsg_get_string(o);
                                }