diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-12-08 17:48:24 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-12-11 03:42:58 +0100 |
commit | dd97950d26f0d5642bf4522219c1f7e475de6454 (patch) | |
tree | 0698b51f0921316f2290f0b5b22120b4c530b1f4 | |
parent | c0f00072929b126b21ba7bdfa2c93327ba652d08 (diff) |
gsm/oap: more robust: decode presence as clearly either 1 or 0
Prepares for the unit test, which can now simply check for encode/decode
identity.
Change-Id: I410ff120d868e8d55df9cb19ba6eefd99749cdf0
-rw-r--r-- | src/gsm/oap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gsm/oap.c b/src/gsm/oap.c index 979bde65..1494a6a6 100644 --- a/src/gsm/oap.c +++ b/src/gsm/oap.c @@ -92,7 +92,7 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, return -GMM_CAUSE_PROTO_ERR_UNSPEC; } memcpy(oap_msg->autn, value, value_len); - oap_msg->autn_present = value_len; + oap_msg->autn_present = value_len ? 1 : 0; break; case OAP_RAND_IE: @@ -103,7 +103,7 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, return -GMM_CAUSE_PROTO_ERR_UNSPEC; } memcpy(oap_msg->rand, value, value_len); - oap_msg->rand_present = value_len; + oap_msg->rand_present = value_len ? 1 : 0; break; case OAP_XRES_IE: @@ -114,7 +114,7 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, return -GMM_CAUSE_PROTO_ERR_UNSPEC; } memcpy(oap_msg->xres, value, value_len); - oap_msg->xres_present = value_len; + oap_msg->xres_present = value_len ? 1 : 0; break; case OAP_AUTS_IE: @@ -125,7 +125,7 @@ int osmo_oap_decode(struct osmo_oap_message *oap_msg, return -GMM_CAUSE_PROTO_ERR_UNSPEC; } memcpy(oap_msg->auts, value, value_len); - oap_msg->auts_present = value_len; + oap_msg->auts_present = value_len ? 1 : 0; break; case OAP_CAUSE_IE: |