Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] E212 Mobile network code is not caculated correctly?

From: "Zhang, Long \(Roger\)" <zhangl@xxxxxxxxxxxxxxxxxx>
Date: Fri, 9 Jan 2009 11:25:22 +0800

Hi,

 

I am developing based on Wireshark 1.0.0.  I found the mnc in E212 may not be caculated correctly.  The mnc for 3 digits is calculated as “mnc += 10 * mnc + mnc3;”. I think it should be “mnc = 10 * mnc + mnc3;”.  From E212 spec, I did not find algorithm to calculate mnc, but I think += is not correct. Is it a bug?

 

epan/dissectors/packet-e212.c

 

int

dissect_e212_mcc_mnc(tvbuff_t *tvb, proto_tree *tree, int offset){

 

……

 

        mcc = 100 * mcc1 + 10 * mcc2 + mcc3;

        mnc = 10 * mnc1 + mnc2;

        if (mnc3 != 0xf) {

                mnc += 10 * mnc + mnc3;

        }

……

        return offset;

}

 

Thanks,

Roger