diff -Nur haproxy-1.3.13-orig/src/cfgparse.c haproxy-1.3.13-nodup/src/cfgparse.c --- haproxy-1.3.13-orig/src/cfgparse.c 2007-10-18 22:38:22.000000000 +0200 +++ haproxy-1.3.13-nodup/src/cfgparse.c 2007-10-19 14:30:37.000000000 +0200 @@ -500,7 +500,7 @@ */ int cfg_parse_listen(const char *file, int linenum, char **args) { - static struct proxy *curproxy = NULL; + static struct proxy *curproxy; struct server *newsrv = NULL; const char *err; int rc, val; @@ -523,6 +523,14 @@ file, linenum, args[0]); return -1; } + + for (curproxy = proxy; curproxy != NULL; curproxy = curproxy->next) + if (!strcmp(curproxy->id, args[1]) && + ((curproxy->cap==rc) || (curproxy->cap & rc & (PR_CAP_FE | PR_CAP_BE)))) { + Alert("parsing %s: duplicated proxy %s with conflicting capabilities: %X/%X!\n", + file, args[1], curproxy->cap, rc); + return -1; + } if ((curproxy = (struct proxy *)calloc(1, sizeof(struct proxy))) == NULL) { Alert("parsing [%s:%d] : out of memory.\n", file, linenum);