Hi Holger,
On Thu, 2014-03-20 at 22:20, Holger Hans Peter Freyther wrote:
On Wed, Mar 12, 2014 at 09:06:29PM +0400, Alexander
Chemeris wrote:
+static time_t gsm340_vp_relative_integer(uint8_t
*sms_vp)
{
uint8_t vp;
- unsigned long minutes;
vp = *(sms_vp);
if (vp == 0) {
LOGP(DLSMS, LOGL_ERROR,
"reserved relative_integer validity period\n");
- return gsm340_vp_default();
+#warning We should return an RP-Error here.
+ return SMS_DEFAULT_VALIDITY_PERIOD;
What does this warning mean? The code will not be able to generate
and initiate the RP-Error procedure. So how do you intend to indicate
the error condition? What should the caler do?
The GSM spec wants us to send back an RP-Error in this case as well as
in the default: of gsm340_validity_period(). The latter already has a
FIXME comment in it and I just wanted to make sure we don't forget this
case if we implement the rp-error.
That's why I asked that we either put a FIXME or #warning here.
I think we can signal an error condition by returning 0 (both in
gsm340_vp_relative_integer() and in gsm340_validity_time() and the
caller of gsm340_validity_time() can then deal with the error and return
a proper RP-Error in the future.
Thinking about it I guess we should implement it like that right now.
Regards,
Daniel
--
- Daniel Willmann <dwillmann(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Schivelbeiner Str. 5
* 10439 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte