Module Name:    src
Committed By:   mlelstv
Date:           Sun Mar 26 01:04:16 UTC 2023

Modified Files:
        src/sbin/ifconfig: carp.c ifconfig.8

Log Message:
Fix parser for carp state.
The state values are uppercase words INIT, BACKUP and MASTER.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/ifconfig/carp.c
cvs rdiff -u -r1.124 -r1.125 src/sbin/ifconfig/ifconfig.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ifconfig/carp.c
diff -u src/sbin/ifconfig/carp.c:1.14 src/sbin/ifconfig/carp.c:1.15
--- src/sbin/ifconfig/carp.c:1.14	Sun Jun  7 06:02:58 2020
+++ src/sbin/ifconfig/carp.c	Sun Mar 26 01:04:16 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $ */
+/* $NetBSD: carp.c,v 1.15 2023/03/26 01:04:16 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $");
+__RCSID("$NetBSD: carp.c,v 1.15 2023/03/26 01:04:16 mlelstv Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -67,10 +67,16 @@ static int setcarpdev(prop_dictionary_t,
 
 static const char *carp_states[] = { CARP_STATES };
 
+/* from if_carp.c */
+enum carpstateval { INIT = 0, BACKUP, MASTER };
+
 struct kwinst carpstatekw[] = {
-	  {.k_word = "INIT", .k_nextparser = &command_root.pb_parser}
-	, {.k_word = "BACKUP", .k_nextparser = &command_root.pb_parser}
-	, {.k_word = "MASTER", .k_nextparser = &command_root.pb_parser}
+	  {.k_word = "INIT", .k_type = KW_T_INT, .k_int = INIT,
+	   .k_nextparser = &command_root.pb_parser}
+	, {.k_word = "BACKUP", .k_type = KW_T_INT, .k_int = BACKUP,
+	   .k_nextparser = &command_root.pb_parser}
+	, {.k_word = "MASTER", .k_type = KW_T_INT, .k_int = MASTER,
+	   .k_nextparser = &command_root.pb_parser}
 };
 
 struct pinteger parse_advbase = PINTEGER_INITIALIZER1(&parse_advbase, "advbase",

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.124 src/sbin/ifconfig/ifconfig.8:1.125
--- src/sbin/ifconfig/ifconfig.8:1.124	Fri Nov 25 08:41:05 2022
+++ src/sbin/ifconfig/ifconfig.8	Sun Mar 26 01:04:16 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.124 2022/11/25 08:41:05 knakahara Exp $
+.\"	$NetBSD: ifconfig.8,v 1.125 2023/03/26 01:04:16 mlelstv Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -315,10 +315,10 @@ Explicitly force the
 .Xr carp 4
 pseudo-device to enter this state.
 Valid states are
-.Ar init ,
-.Ar backup ,
+.Ar INIT ,
+.Ar BACKUP ,
 and
-.Ar master .
+.Ar MASTER .
 .It Cm frag Ar threshold
 .Pq IEEE 802.11 devices only
 Configure the fragmentation threshold for IEEE 802.11-based wireless

Reply via email to