summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre')
-rw-r--r--cleopatre/u-boot-1.1.6/net/spidupd.c13
-rw-r--r--cleopatre/u-boot-1.1.6/net/spidupd.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/cleopatre/u-boot-1.1.6/net/spidupd.c b/cleopatre/u-boot-1.1.6/net/spidupd.c
index 3074d1576d..a8dedff57b 100644
--- a/cleopatre/u-boot-1.1.6/net/spidupd.c
+++ b/cleopatre/u-boot-1.1.6/net/spidupd.c
@@ -687,15 +687,20 @@ static void SpidupdHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len
uchar md5_client[16];
struct update_image *image = ctx.image;
struct update_place *place = ctx.place;
-
- /* We received MME packet from PC client, reset the NETLOOP Timeout */
- NetSetTimeout(TIMEOUT * CFG_HZ, SpidupdTimeout);
+ ushort mmtype;
/* Set structures pointers */
mme = (MME_t *)pkt;
ms_update_start_req = (MsUpdStartReq_t *)(mme+1);
ms_update_transfer_req = (MsUpdTransfReq_t *)(mme+1);
ms_update_end_req = (MsUpdEndReq_t *)(mme+1);
+ mmtype = (ushort)(mmetohs(mme->mmtype));
+
+ if(!MS_UPDATE_RANGE(mmtype))
+ return;
+
+ /* We received MME packet from PC client, reset the NETLOOP Timeout */
+ NetSetTimeout(TIMEOUT * CFG_HZ, SpidupdTimeout);
/*
* Server will now analyze the message and
@@ -705,7 +710,7 @@ static void SpidupdHandler(uchar *pkt, unsigned dest, unsigned src, unsigned len
* 3) go to the next state
*/
- switch( (ushort)(mmetohs(mme->mmtype)) )
+ switch(mmtype)
{
case MS_UPDATE_START_REQ:
TRACE("Got MS_UPDATE_START_REQ\n");
diff --git a/cleopatre/u-boot-1.1.6/net/spidupd.h b/cleopatre/u-boot-1.1.6/net/spidupd.h
index 0f0bcb6024..e8026a234d 100644
--- a/cleopatre/u-boot-1.1.6/net/spidupd.h
+++ b/cleopatre/u-boot-1.1.6/net/spidupd.h
@@ -53,6 +53,8 @@
#define MS_UPDATE_END_CNF (MS_UPDATE_END | 0x1)
#define MS_UPDATE_END_IND (MS_UPDATE_END | 0x2)
+#define MS_UPDATE_RANGE(type) ((type >= MS_UPDATE_START) && (type <= MS_UPDATE_END))
+
/*
* SPIDUPD Primitive types
*/