summaryrefslogtreecommitdiff
path: root/L3Code.c
diff options
context:
space:
mode:
Diffstat (limited to 'L3Code.c')
-rw-r--r--L3Code.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/L3Code.c b/L3Code.c
index 84ebbdd..30dac2a 100644
--- a/L3Code.c
+++ b/L3Code.c
@@ -403,7 +403,9 @@ VOID PROCESSNODEMESSAGE(MESSAGE * Msg, struct PORTCONTROL * PORT)
memset(DEST, 0, sizeof(struct DEST_LIST));
memcpy(DEST->DEST_CALL, Msg->ORIGIN, 7);
-
+ if (DEST->RouteLastTT == 0)
+ DEST->RouteLastTT = (uint16_t *)zalloc(MAXNEIGHBOURS * sizeof(uint16_t));
+
NUMBEROFNODES++;
}
@@ -582,6 +584,9 @@ VOID PROCESSNODEMESSAGE(MESSAGE * Msg, struct PORTCONTROL * PORT)
memset(DEST, 0, sizeof(struct DEST_LIST));
memcpy(DEST->DEST_CALL, ptr1, 7);
+ if (DEST->RouteLastTT == 0)
+ DEST->RouteLastTT = (uint16_t *)zalloc(MAXNEIGHBOURS * sizeof(uint16_t));
+
NUMBEROFNODES++;
}
@@ -1369,6 +1374,10 @@ VOID REMOVENODE(dest_list * DEST)
}
L4++;
}
+
+ if (DEST->RouteLastTT)
+ free(DEST->RouteLastTT);
+
memset(DEST, 0, sizeof(struct DEST_LIST));
NUMBEROFNODES--;
}
@@ -1523,7 +1532,10 @@ struct DEST_LIST * CHECKL3TABLES(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * Msg
#endif
memcpy(DEST->DEST_CALL, Msg->L3SRCE, 7);
-
+
+ if (DEST->RouteLastTT == 0)
+ DEST->RouteLastTT = (uint16_t *)zalloc(MAXNEIGHBOURS * sizeof(uint16_t));
+
NUMBEROFNODES++;
// MAKE SURE NEIGHBOUR IS DEFINED FOR DESTINATION