Added pid in cwmp id as a identifier

This commit is contained in:
Vivek Kumar Dutta 2023-06-26 16:38:22 +05:30
parent 09b7cd7a6b
commit 26a56bc6f8
No known key found for this signature in database
GPG key ID: 65C818099F37097D

View file

@ -1489,9 +1489,10 @@ int xml_set_cwmp_id()
{
char c[32];
mxml_node_t *b;
int pid_t = getpid();
/* define cwmp id */
if (snprintf(c, sizeof(c), "%u", ++(cwmp_main->cwmp_id)) == -1)
if (snprintf(c, sizeof(c), "%d.%u", pid_t, ++(cwmp_main->cwmp_id)) == -1)
return -1;
b = mxmlFindElement(cwmp_main->session->tree_out, cwmp_main->session->tree_out, "cwmp:ID", NULL, NULL, MXML_DESCEND);