Merge "pbx_dundi: Fix debug frame decode string."

This commit is contained in:
Joshua Colp
2018-08-21 18:52:46 -05:00
committed by Gerrit Code Review

View File

@@ -446,7 +446,7 @@ void dundi_showframe(struct dundi_hdr *fhi, int rx, struct sockaddr_in *sin, int
"INVALID ", "INVALID ",
"UNKNOWN CMD ", "UNKNOWN CMD ",
"NULL ", "NULL ",
"REQREQ ", "REGREQ ",
"REGRESPONSE ", "REGRESPONSE ",
"CANCEL ", "CANCEL ",
"ENCRYPT ", "ENCRYPT ",
@@ -456,15 +456,15 @@ void dundi_showframe(struct dundi_hdr *fhi, int rx, struct sockaddr_in *sin, int
char subclass2[20]; char subclass2[20];
char *subclass; char *subclass;
char tmp[256]; char tmp[256];
if ((fhi->cmdresp & 0x3f) > (int)sizeof(commands)/(int)sizeof(char *)) { if ((fhi->cmdresp & 0x3f) >= ARRAY_LEN(commands)) {
snprintf(class2, (int)sizeof(class2), "(%d?)", fhi->cmdresp); snprintf(class2, sizeof(class2), "(%d?)", fhi->cmdresp & 0x3f);
class = class2; class = class2;
} else { } else {
class = commands[(int)(fhi->cmdresp & 0x3f)]; class = commands[fhi->cmdresp & 0x3f];
} }
snprintf(subclass2, (int)sizeof(subclass2), "%02hhx", (unsigned char)fhi->cmdflags); snprintf(subclass2, sizeof(subclass2), "%02hhx", (unsigned char)fhi->cmdflags);
subclass = subclass2; subclass = subclass2;
snprintf(tmp, (int)sizeof(tmp), snprintf(tmp, sizeof(tmp),
"%s-Frame -- OSeqno: %3.3d ISeqno: %3.3d Type: %s (%s)\n", "%s-Frame -- OSeqno: %3.3d ISeqno: %3.3d Type: %s (%s)\n",
pref[rx], pref[rx],
fhi->oseqno, fhi->iseqno, class, fhi->cmdresp & 0x40 ? "Response" : "Command"); fhi->oseqno, fhi->iseqno, class, fhi->cmdresp & 0x40 ? "Response" : "Command");