diff --git a/src/cfgparse.c b/src/cfgparse.c
index 2245f51..d4cfa86 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -596,7 +596,7 @@
  * Note: this function can also be used to parse a thread number or a set of
  * threads.
  */
-static int parse_process_number(const char *arg, unsigned long *proc, char **err)
+int parse_process_number(const char *arg, unsigned long *proc, char **err)
 {
 	if (strcmp(arg, "all") == 0)
 		*proc |= ~0UL;
@@ -3283,43 +3283,12 @@
 		unsigned long set = 0;
 
 		while (*args[cur_arg]) {
-			unsigned int low, high;
-
 			if (strcmp(args[cur_arg], "all") == 0) {
 				set = 0;
 				break;
 			}
-			else if (strcmp(args[cur_arg], "odd") == 0) {
-				set |= ~0UL/3UL; /* 0x555....555 */
-			}
-			else if (strcmp(args[cur_arg], "even") == 0) {
-				set |= (~0UL/3UL) << 1; /* 0xAAA...AAA */
-			}
-			else if (isdigit((int)*args[cur_arg])) {
-				char *dash = strchr(args[cur_arg], '-');
-
-				low = high = str2uic(args[cur_arg]);
-				if (dash)
-					high = str2uic(dash + 1);
-
-				if (high < low) {
-					unsigned int swap = low;
-					low = high;
-					high = swap;
-				}
-
-				if (low < 1 || high > LONGBITS) {
-					Alert("parsing [%s:%d]: %s supports process numbers from 1 to %d.\n",
-					      file, linenum, args[0], LONGBITS);
-					err_code |= ERR_ALERT | ERR_FATAL;
-					goto out;
-				}
-				while (low <= high)
-					set |= 1UL << (low++ - 1);
-			}
-			else {
-				Alert("parsing [%s:%d]: %s expects 'all', 'odd', 'even', or a list of process ranges with numbers from 1 to %d.\n",
-				      file, linenum, args[0], LONGBITS);
+			if (parse_process_number(args[cur_arg], &set, &errmsg)) {
+				Alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
 				err_code |= ERR_ALERT | ERR_FATAL;
 				goto out;
 			}
diff --git a/src/cli.c b/src/cli.c
index 6625a09..05cc15e 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -323,43 +323,12 @@
 		}
 
 		while (*args[cur_arg]) {
-			unsigned int low, high;
-
 			if (strcmp(args[cur_arg], "all") == 0) {
 				set = 0;
 				break;
 			}
-			else if (strcmp(args[cur_arg], "odd") == 0) {
-				set |= ~0UL/3UL; /* 0x555....555 */
-			}
-			else if (strcmp(args[cur_arg], "even") == 0) {
-				set |= (~0UL/3UL) << 1; /* 0xAAA...AAA */
-			}
-			else if (isdigit((int)*args[cur_arg])) {
-				char *dash = strchr(args[cur_arg], '-');
-
-				low = high = str2uic(args[cur_arg]);
-				if (dash)
-					high = str2uic(dash + 1);
-
-				if (high < low) {
-					unsigned int swap = low;
-					low = high;
-					high = swap;
-				}
-
-				if (low < 1 || high > LONGBITS) {
-					memprintf(err, "'%s %s' supports process numbers from 1 to %d.\n",
-					          args[0], args[1], LONGBITS);
-					return -1;
-				}
-				while (low <= high)
-					set |= 1UL << (low++ - 1);
-			}
-			else {
-				memprintf(err,
-				          "'%s %s' expects 'all', 'odd', 'even', or a list of process ranges with numbers from 1 to %d.\n",
-				          args[0], args[1], LONGBITS);
+			if (parse_process_number(args[cur_arg], &set, err)) {
+				memprintf(err, "'%s %s' : %s", args[0], args[1], *err);
 				return -1;
 			}
 			cur_arg++;
diff --git a/src/listener.c b/src/listener.c
index aede0d3..a06a464 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -19,6 +19,7 @@
 #include <fcntl.h>
 
 #include <common/accept4.h>
+#include <common/cfgparse.h>
 #include <common/config.h>
 #include <common/errors.h>
 #include <common/mini-clist.h>
@@ -941,39 +942,9 @@
 static int bind_parse_process(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
 {
 	unsigned long set = 0;
-	unsigned int low, high;
 
-	if (strcmp(args[cur_arg + 1], "all") == 0) {
-		set |= ~0UL;
-	}
-	else if (strcmp(args[cur_arg + 1], "odd") == 0) {
-		set |= ~0UL/3UL; /* 0x555....555 */
-	}
-	else if (strcmp(args[cur_arg + 1], "even") == 0) {
-		set |= (~0UL/3UL) << 1; /* 0xAAA...AAA */
-	}
-	else if (isdigit((int)*args[cur_arg + 1])) {
-		char *dash = strchr(args[cur_arg + 1], '-');
-
-		low = high = str2uic(args[cur_arg + 1]);
-		if (dash)
-			high = str2uic(dash + 1);
-
-		if (high < low) {
-			unsigned int swap = low;
-			low = high;
-			high = swap;
-		}
-
-		if (low < 1 || high > LONGBITS) {
-			memprintf(err, "'%s' : invalid range %d-%d, allowed range is 1..%d", args[cur_arg], low, high, LONGBITS);
-			return ERR_ALERT | ERR_FATAL;
-		}
-		while (low <= high)
-			set |= 1UL << (low++ - 1);
-	}
-	else {
-		memprintf(err, "'%s' expects 'all', 'odd', 'even', or a process range with numbers from 1 to %d.", args[cur_arg], LONGBITS);
+	if (parse_process_number(args[cur_arg + 1], &set, err)) {
+		memprintf(err, "'%s' : %s", args[cur_arg], *err);
 		return ERR_ALERT | ERR_FATAL;
 	}
 
