summaryrefslogtreecommitdiff
path: root/main/callerid.c
diff options
context:
space:
mode:
authorRuss Meyerriecks <rmeyerreicks@digium.com>2014-03-17 22:24:03 +0000
committerRuss Meyerriecks <rmeyerreicks@digium.com>2014-03-17 22:24:03 +0000
commited50ef4dc87f16ee32914f1e1d28fe74902d3a83 (patch)
tree2c2634bcaeae3b8d0f95743f002bc2c1fd457a8a /main/callerid.c
parenteba91d2a98ac5a6558513549670162ab20ab6d68 (diff)
callerid: Logic error in checksum processing
Callerid checksum-ing was being handled incorrectly here. When the checksum is calculated to be 0x00, it will perform 0x100-0x00 which results in 0x100. This value will then fail the otherwise correct callerid message. This patch changes the logic to simply add the calculated checksum to the transmitted 2's compliment checksum. Review: https://reviewboard.asterisk.org/r/3356/ (closes issue ASTERISK-23488) ........ This is a merge of merged revisions 410750 410747 from http://svn.asterisk.org/svn/asterisk/branches/12 I didn't want a broken patch to be comitted to trunk so I pre-merge merged them. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/callerid.c')
-rw-r--r--main/callerid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/callerid.c b/main/callerid.c
index db5e795ff..849579ec8 100644
--- a/main/callerid.c
+++ b/main/callerid.c
@@ -621,7 +621,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, stru
}
break;
case 5: /* Check checksum */
- if (b != (256 - (cid->cksum & 0xff))) {
+ if ((b + cid->cksum) & 0xff) {
ast_log(LOG_NOTICE, "Caller*ID failed checksum\n");
/* Try again */
cid->sawflag = 0;