Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 915:9bd18fa4e601
Fix macro to avoid infinite loop in some situations
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Sat, 02 Feb 2013 14:43:09 +0100 |
parents | 4382d7420e65 |
children | 058e95c3a336 |
comparison
equal
deleted
inserted
replaced
914:b6b631c268f3 | 915:9bd18fa4e601 |
---|---|
103 #define GETAVPHDRSZ( _flag ) ((_flag & AVP_FLAG_VENDOR) ? AVPHDRSZ_VENDOR : AVPHDRSZ_NOVEND) | 103 #define GETAVPHDRSZ( _flag ) ((_flag & AVP_FLAG_VENDOR) ? AVPHDRSZ_VENDOR : AVPHDRSZ_NOVEND) |
104 | 104 |
105 /* Macro to cast a msg_avp_t */ | 105 /* Macro to cast a msg_avp_t */ |
106 #define _A(_x) ((struct avp *)(_x)) | 106 #define _A(_x) ((struct avp *)(_x)) |
107 /* Check the type and eyecatcher */ | 107 /* Check the type and eyecatcher */ |
108 #define CHECK_AVP(_x) ((_C(_x)->type == MSG_AVP) && (_A(_x)->avp_eyec == MSG_AVP_EYEC)) | 108 #define CHECK_AVP(_x) ((_x) && (_C(_x)->type == MSG_AVP) && (_A(_x)->avp_eyec == MSG_AVP_EYEC)) |
109 | 109 |
110 /* The following structure represents an instance of a message (command and children AVPs). */ | 110 /* The following structure represents an instance of a message (command and children AVPs). */ |
111 struct msg { | 111 struct msg { |
112 struct msg_avp_chain msg_chain; /* List of the AVPs in the message */ | 112 struct msg_avp_chain msg_chain; /* List of the AVPs in the message */ |
113 int msg_eyec; /* Must be equal to MSG_MSG_EYEC */ | 113 int msg_eyec; /* Must be equal to MSG_MSG_EYEC */ |