X-Git-Url: http://git.onelab.eu/?p=iptables.git;a=blobdiff_plain;f=extensions%2Flibipt_XOR.c;fp=extensions%2Flibipt_XOR.c;h=23979164cb21740120a12112345918a74e1bfba7;hp=3b05a30903fb20dc854b64f5d97e5ecf2ff9fbc0;hb=6afea0b41dfbc3824956d11d960ad80097218feb;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035 diff --git a/extensions/libipt_XOR.c b/extensions/libipt_XOR.c index 3b05a30..2397916 100644 --- a/extensions/libipt_XOR.c +++ b/extensions/libipt_XOR.c @@ -47,6 +47,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': strncpy(info->key, optarg, 30); + info->key[29] = '\0'; *flags |= IPT_KEY_SET; break; case '2': @@ -92,18 +93,19 @@ static struct option opts[] = { { 0 } }; -static struct iptables_target XOR = { NULL, - "XOR", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ipt_XOR_info)), - IPT_ALIGN(sizeof(struct ipt_XOR_info)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +static struct iptables_target XOR = { + .next = NULL, + .name = "XOR", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ipt_XOR_info)), + .userspacesize = IPT_ALIGN(sizeof(struct ipt_XOR_info)), + .help = &help, + .init = &init, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void _init(void)