From 764316a133db8e5e2d1f2a9d941ffae993d7c9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Kis-Szab=C3=B3?= Date: Mon, 26 Feb 2001 17:31:20 +0000 Subject: ip6tables-save/-restore by Kis-Szabo Andras --- extensions/libipt_string.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'extensions') diff --git a/extensions/libipt_string.c b/extensions/libipt_string.c index 25dacdc5..51e5828e 100644 --- a/extensions/libipt_string.c +++ b/extensions/libipt_string.c @@ -1,6 +1,12 @@ /* Shared library add-on to iptables to add string matching support. * * Copyright (C) 2000 Emmanuel Roger + * + * ChangeLog + * 27.01.2001: Gianni Tedesco + * Changed --tos to --string in save(). Also + * updated to work with slightly modified + * ipt_string_info. */ #include #include @@ -38,7 +44,7 @@ init(struct ipt_entry_match *m, unsigned int *nfcache) static void parse_string(const unsigned char *s, struct ipt_string_info *info) { - if (strlen(s) <= 255) strcpy(info->string, s); + if (strlen(s) <= BM_MAX_LEN) strcpy(info->string, s); else exit_error(PARAMETER_PROBLEM, "STRING too long `%s'", s); } @@ -59,6 +65,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, parse_string(argv[optind-1], stringinfo); if (invert) stringinfo->invert = 1; + stringinfo->len=strlen((char *)&stringinfo->string); *flags = 1; break; @@ -101,7 +108,7 @@ print(const struct ipt_ip *ip, static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) { - printf("--tos "); + printf("--string "); print_string(((struct ipt_string_info *)match->data)->string, ((struct ipt_string_info *)match->data)->invert, 0); } -- cgit v1.2.3