All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libip6t_HL.c bugfix similar to libipt_TTL.c
@ 2004-07-28 10:38 Maciej Soltysiak
  2004-07-28 11:51 ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej Soltysiak @ 2004-07-28 10:38 UTC (permalink / raw)
  To: netfilter-devel

Hi,

this is a similar bugfix to the one about libipt_TTL.c

Please apply,
Regards,
Maciej Soltysiak

Index: libip6t_HL.c
===================================================================
RCS file: /cvspublic/iptables/extensions/libip6t_HL.c,v
retrieving revision 1.1
diff -u -r1.1 libip6t_HL.c
--- libip6t_HL.c        8 Jan 2003 09:14:20 -0000       1.1
+++ libip6t_HL.c        28 Jul 2004 10:37:47 -0000
@@ -24,9 +24,9 @@
 {
        printf(
 "HL target v%s options\n"
-"  --hl-set value              Set HL to <value>\n"
-"  --hl-dec value              Decrement HL by <value>\n"
-"  --hl-inc value              Increment HL by <value>\n"
+"  --hl-set value              Set HL to <value 0-255>\n"
+"  --hl-dec value              Decrement HL by <value 1-255>\n"
+"  --hl-inc value              Increment HL by <value 1-255>\n"
 , IPTABLES_VERSION);
 }

@@ -35,7 +35,7 @@
                struct ip6t_entry_target **target)
 {
        struct ip6t_HL_info *info = (struct ip6t_HL_info *) (*target)->data;
-       u_int8_t value;
+       unsigned int value;

        if (*flags & IP6T_HL_USED) {
                exit_error(PARAMETER_PROBLEM,
@@ -50,8 +50,9 @@
                exit_error(PARAMETER_PROBLEM,
                                "HL: unexpected `!'");

-       value = atoi(optarg);
-
+        if (string_to_number(optarg, 0, 255, &value) == -1)
+                        exit_error(PARAMETER_PROBLEM,
+                                   "HL: Expected value between 0 and 255");
        switch (c) {

                case '1':
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-28 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-28 10:38 [PATCH] libip6t_HL.c bugfix similar to libipt_TTL.c Maciej Soltysiak
2004-07-28 11:51 ` Patrick McHardy
     [not found]   ` <254259562.20040728140825@dns.toxicfilms.tv>
2004-07-28 14:12     ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.