mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-05 20:26:38 +02:00
iface: constify data arrays
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
#include <xtables.h>
|
#include <xtables.h>
|
||||||
#include "xt_iface.h"
|
#include "xt_iface.h"
|
||||||
|
|
||||||
static struct option iface_mt_opts[] = {
|
static const struct option iface_mt_opts[] = {
|
||||||
{.name = "iface", .has_arg = true, .flag = 0, .val = 'i'},
|
{.name = "iface", .has_arg = true, .flag = 0, .val = 'i'},
|
||||||
{.name = "up", .has_arg = false, .flag = 0, .val = 'u'},
|
{.name = "up", .has_arg = false, .flag = 0, .val = 'u'},
|
||||||
{.name = "down", .has_arg = false, .flag = 0, .val = 'U'}, /* not up */
|
{.name = "down", .has_arg = false, .flag = 0, .val = 'U'}, /* not up */
|
||||||
@@ -60,7 +60,7 @@ static void iface_setflag(struct xt_iface_mtinfo *info,
|
|||||||
|
|
||||||
static bool iface_valid_name(const char *name)
|
static bool iface_valid_name(const char *name)
|
||||||
{
|
{
|
||||||
char invalid_chars[] = ".+!*";
|
static const char invalid_chars[] = ".+!*";
|
||||||
|
|
||||||
return strlen(name) < IFNAMSIZ && strpbrk(name, invalid_chars) == NULL;
|
return strlen(name) < IFNAMSIZ && strpbrk(name, invalid_chars) == NULL;
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ MODULE_ALIAS("ipt_iface");
|
|||||||
MODULE_ALIAS("ip6t_iface");
|
MODULE_ALIAS("ip6t_iface");
|
||||||
//MODULE_ALIAS("arpt_iface");
|
//MODULE_ALIAS("arpt_iface");
|
||||||
|
|
||||||
static struct xt_iface_flag_pairs xt_iface_lookup[] =
|
static const struct xt_iface_flag_pairs xt_iface_lookup[] =
|
||||||
{
|
{
|
||||||
{.iface_flag = XT_IFACE_UP, .iff_flag = IFF_UP},
|
{.iface_flag = XT_IFACE_UP, .iff_flag = IFF_UP},
|
||||||
{.iface_flag = XT_IFACE_BROADCAST, .iff_flag = IFF_BROADCAST},
|
{.iface_flag = XT_IFACE_BROADCAST, .iff_flag = IFF_BROADCAST},
|
||||||
|
Reference in New Issue
Block a user