enum pim_msdp_tlv type;
int len;
int work_cnt = 0;
+ int work_max_cnt = 1;
mp = THREAD_ARG(thread);
mp->t_write = NULL;
pim_msdp_pkt_delete(mp);
++work_cnt;
- /* XXX - may need to pause if we have done too much work in this
+ /* may need to pause if we have done too much work in this
* loop */
+ if (work_cnt >= work_max_cnt) {
+ break;
+ }
} while ((s = stream_fifo_head(mp->obuf)) != NULL);
pim_msdp_write_proceed_actions(mp);
int local_cnt = msdp->local_cnt;
sa_count = 0;
+ if (PIM_DEBUG_MSDP_INTERNAL) {
+ zlog_debug(" sa gen %d", local_cnt);
+ }
+
local_cnt = pim_msdp_pkt_sa_fill_hdr(local_cnt);
for (ALL_LIST_ELEMENTS_RO(msdp->sa_list, sanode, sa)) {
pim_msdp_pkt_sa_push(mp);
/* reset headers */
sa_count = 0;
+ if (PIM_DEBUG_MSDP_INTERNAL) {
+ zlog_debug(" sa gen for remainder %d", local_cnt);
+ }
local_cnt = pim_msdp_pkt_sa_fill_hdr(local_cnt);
}
}
PIM_MSDP_SA_Y_SIZE(entry_cnt))
/* SA TLV has to have atleast only one entry in it so x=8 + y=12 */
#define PIM_MSDP_SA_TLV_MIN_SIZE PIM_MSDP_SA_ENTRY_CNT2SIZE(1)
-#define PIM_MSDP_SA_MAX_ENTRY_CNT ((PIM_MSDP_SA_TLV_MAX_SIZE - PIM_MSDP_SA_X_SIZE)/PIM_MSDP_SA_ONE_ENTRY_SIZE)
+/* XXX: theoretically we can fix a max of 255 but that may result in packet
+ * fragmentation */
+#define PIM_MSDP_SA_MAX_ENTRY_CNT 120
#define PIM_MSDP_MAX_PACKET_SIZE max(PIM_MSDP_SA_TLV_MAX_SIZE, PIM_MSDP_KA_TLV_MAX_SIZE)