This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
udp tweak
- From: Mark Salter <msalter at redhat dot com>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Tue, 30 Mar 2004 14:09:21 -0500 (EST)
- Subject: udp tweak
This fixes a problem I ran into on a network with lots of duplicates
on it.
--Mark
Index: redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.189
diff -u -p -5 -r1.189 ChangeLog
--- redboot/current/ChangeLog 18 Mar 2004 15:14:11 -0000 1.189
+++ redboot/current/ChangeLog 30 Mar 2004 15:21:20 -0000
@@ -1,5 +1,10 @@
+2004-03-30 Mark Salter <msalter@redhat.com>
+
+ * src/net/udp.c (__udp_recvfrom_handler): Protect against back-to-back
+ duplicate packets.
+
2004-03-17 Thomas Koeller <thomas.koeller@baslerweb.com>
* src/fs/fileio.c: Only include IO package headers if required.
2004-03-02 Andrew Dyer <adyer@righthandtech.com>
Index: redboot/current/src/net/udp.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/net/udp.c,v
retrieving revision 1.10
diff -u -p -5 -r1.10 udp.c
--- redboot/current/src/net/udp.c 19 Aug 2003 17:23:11 -0000 1.10
+++ redboot/current/src/net/udp.c 30 Mar 2004 15:21:20 -0000
@@ -6,11 +6,11 @@
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc.
// Copyright (C) 2002, 2003 Gary Thomas
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
@@ -217,10 +217,10 @@ static struct sockaddr_in *recvfrom_serv
static void
__udp_recvfrom_handler(udp_socket_t *skt, char *buf, int len,
ip_route_t *src_route, word src_port)
{
- if (recvfrom_server == NULL)
+ if (recvfrom_server == NULL || recvfrom_buf == NULL)
return;
if (recvfrom_server->sin_port && recvfrom_server->sin_port != htons(src_port))
return;