summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorThierry Carré2011-09-16 16:57:18 +0200
committerThierry Carré2011-10-20 10:37:49 +0200
commitf9f330e6f93c29ef937fdd67fc919417c1af6468 (patch)
treed81ebc6dac617befb48860c0b771b13a9f54cd64 /cesar/cp
parentcc6e6e85e3f592fd9376eb1c30383d19212d0f4b (diff)
cesar/cp/msg: fix a bug for specific message fragmented
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/msg/src/msg_cc.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/cesar/cp/msg/src/msg_cc.c b/cesar/cp/msg/src/msg_cc.c
index 5de8174da0..d0061a5752 100644
--- a/cesar/cp/msg/src/msg_cc.c
+++ b/cesar/cp/msg/src/msg_cc.c
@@ -913,7 +913,9 @@ cp_msg_cc_discover_list_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
cp_msg_cc_discover_list_ctx_t *disc_ctx)
{
cp_mme_tx_t *mme;
- uint mme_length;
+ uint data_length;
+ uint header_length;
+ uint nf_mi;
uint nb_sta_length;
uint nb_net_length;
@@ -929,18 +931,24 @@ cp_msg_cc_discover_list_cnf_send_begin (cp_t *ctx, cp_mme_peer_t *peer,
nb_sta_length = 1 + nb_sta * 12; // see Table 11-193.
nb_net_length = 1 + nb_net * 13; // see Table 11-193.
- mme_length = (peer->vlan_tag ? HPAV_MME_HEADER_LEN_WITH_VLAN :
- HPAV_MME_HEADER) + nb_sta_length + nb_net_length;
+ header_length = peer->vlan_tag ? HPAV_MME_HEADER_LEN_WITH_VLAN :
+ HPAV_MME_HEADER;
+ data_length = nb_sta_length + nb_net_length;
- if (mme_length <= ETH_PACKET_MAX_SIZE)
+ /* Fragmentation Management Information –
+ * 4 bits are Number of Fragments (NF_MI) of the MMENTRY
+ * 0x00 = MMENTRY is not Fragmented
+ * 0x01 = MMENTRY is Fragmented into two parts
+ * 0x02 = MMENTRY is Fragmented into three parts, and so on
+ **/
+ nf_mi = data_length / (ETH_PACKET_MAX_SIZE - header_length);
+
+ if (nf_mi == 0)
mme = cp_msg_mme_init (ctx, peer, CC_DISCOVER_LIST_CNF);
else
{
- uint nbFrag;
-
- nbFrag = mme_length / ETH_PACKET_MAX_SIZE;
mme = cp_msg_mme_init_frag (
- ctx, peer, CC_DISCOVER_LIST_CNF, nbFrag, 0);
+ ctx, peer, CC_DISCOVER_LIST_CNF, nf_mi, 0);
bitstream_init_buffer_cb (
&mme->bitstream,