diff -urNbp mpd.orig/src/fsm.c mpd/src/fsm.c --- mpd.orig/src/fsm.c 2009-05-13 07:45:43.000000000 +0600 +++ mpd/src/fsm.c 2009-08-17 15:05:14.000000000 +0600 @@ -586,6 +586,11 @@ FsmRecvConfigReq(Fsm fp, FsmHeader lhp, /* State specific actions */ switch (fp->state) { case ST_OPENED: + if ((fp->type->link_layer) && !(((Link)(fp->arg))->conf.rcr)) { + Log(fp->log, ("[%s] %s: Oops, RCR in %s, ignoring", Pref(fp), Fsm(fp), FsmStateName(fp->state))); + mbfree(bp); + return; + } FsmLayerDown(fp); FsmSendConfigReq(fp); break; diff -urNbp mpd.orig/src/link.c mpd/src/link.c --- mpd.orig/src/link.c 2009-07-17 18:37:02.000000000 +0600 +++ mpd/src/link.c 2009-08-17 15:03:39.000000000 +0600 @@ -53,7 +53,8 @@ SET_ENABLE, SET_DISABLE, SET_YES, - SET_NO + SET_NO, + SET_RCR }; #define RBUF_SIZE 100 @@ -120,6 +121,8 @@ LinkSetCommand, NULL, 2, (void *) SET_YES }, { "no {opt ...}", "Disable and deny option", LinkSetCommand, NULL, 2, (void *) SET_NO }, + { "rcr {yes|no}", "Reconfig request enable or disable", + LinkSetCommand, NULL, 2, (void *) SET_RCR }, { NULL }, }; @@ -424,6 +427,7 @@ LinkCreate(Context ctx, int ac, char *av l->conf.max_redial = -1; l->conf.retry_timeout = LINK_DEFAULT_RETRY; l->conf.max_children = 10000; + l->conf.rcr = 1; l->bandwidth = LINK_DEFAULT_BANDWIDTH; l->latency = LINK_DEFAULT_LATENCY; l->upReason = NULL; @@ -1265,6 +1269,7 @@ LinkStat(Context ctx, int ac, char *av[] Printf("\tIdent string : \"%s\"\r\n", l->conf.ident ? l->conf.ident : ""); if (l->tmpl) Printf("\tMax children : %d\r\n", l->conf.max_children); + Printf("\tReconfig : %sabled\r\n", l->conf.rcr ? "en": "dis"); Printf("Link incoming actions:\r\n"); SLIST_FOREACH(a, &l->actions, next) { Printf("\t%s\t%s\t%s\r\n", @@ -1567,6 +1572,23 @@ LinkSetCommand(Context ctx, int ac, char strcpy(l->conf.ident = Malloc(MB_LINK, strlen(av[0]) + 1), av[0]); break; + case SET_RCR: + if (ac != 1) + return(-1); + if (*av[0] != '\0') + switch (tolower(*av[0])) { + case 'y': + l->conf.rcr = 1; + break; + case 'n': + l->conf.rcr = 0; + break; + default: + Error("incorrect value \"%s\", only \"yes\" or \"no\" are allowed", av[0]); + return(-1); + } + break; + case SET_ACCEPT: AcceptCommand(ac, av, &l->conf.options, gConfList); if (ctx->lnk->type->update) diff -urNbp mpd.orig/src/link.h mpd/src/link.h --- mpd.orig/src/link.h 2009-07-17 18:37:02.000000000 +0600 +++ mpd/src/link.h 2009-08-17 14:52:36.000000000 +0600 @@ -89,6 +89,7 @@ char *ident; /* LCP ident string */ struct optinfo options; /* Configured options */ int max_children; /* Maximal number of children */ + u_char rcr; /* Do we enable reconfig during network phase, default yes */ }; struct linkbm {