]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
openr2(1/6): bugfix in configuration saving
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Mon, 22 Apr 2019 15:02:23 +0000 (18:02 +0300)
committerOron Peled <oron.peled@xorcom.com>
Mon, 22 Jul 2019 18:11:12 +0000 (21:11 +0300)
Details:
  - The memcpy() call copied part of "dahdi_conf" and not "dahdi_conf.mfcr2"
  - As a result, the memcmp() in dahdi_r2_get_link() always fails
  - This cause dahdi_r2_get_link() to create new link for every channel
    (instead of a new link for every ~30 channels)
  - With the fix, far less links are generated -- so we use far less threads

Change-Id: I7259dd6272f5e46e8a6c7f5bf3e8c2ec01b8c132
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
channels/chan_dahdi.c

index a721d7b17f300ed4e40c9ac1aee85b7ddb2be780..0936d194bc6e618e867e0c1137271a41b2057b34 100644 (file)
@@ -11925,7 +11925,7 @@ static int dahdi_r2_set_context(struct dahdi_mfcr2 *r2_link, const struct dahdi_
                }
        }
        /* Save the configuration used to setup this link */
-       memcpy(&r2_link->conf, conf, sizeof(r2_link->conf));
+       memcpy(&r2_link->conf, &conf->mfcr2, sizeof(r2_link->conf));
        return 0;
 }
 #endif