public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* RFC: bsd_tcp patch on in.c
@ 2013-06-27 11:24 Lambrecht Jürgen
  2013-06-27 13:43 ` Bernd Edlinger
  0 siblings, 1 reply; 2+ messages in thread
From: Lambrecht Jürgen @ 2013-06-27 11:24 UTC (permalink / raw)
  To: ecos-devel

Hello,

The patch below we already use since 2006.
We had problems with the TCP/IP stack directly after booting because it 
already received packets before being initialized completely.
Here our CVS log:

move
     splx(s);
from line 682 to line 739
so that tcp/ip stack has started up before the ethernet driver is released
(else the not-ready stack will already receive packets)

Do you agree this is a valid patch?
--------------------------------------------------------------------------------

Index: net/bsd_tcpip/current/src/sys/netinet/in.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/in.c,v
retrieving revision 1.4
diff -u -5 -p -r1.4 in.c
--- net/bsd_tcpip/current/src/sys/netinet/in.c  29 Jan 2009 17:49:56 -0000      1.4
+++ net/bsd_tcpip/current/src/sys/netinet/in.c  27 Jun 2013 11:03:38 -0000
@@ -675,11 +675,10 @@ in_ifinit(ifp, ia, sin, scrub)
             (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
                 splx(s);
                 ia->ia_addr = oldaddr;
                 return (error);
         }
-       splx(s);
         if (scrub) {
                 ia->ia_ifa.ifa_addr = (struct sockaddr *)&oldaddr;
                 in_ifscrub(ifp, ia);
                 ia->ia_ifa.ifa_addr = (struct sockaddr *)&ia->ia_addr;
         }
@@ -733,10 +732,11 @@ in_ifinit(ifp, ia, sin, scrub)
                 struct in_addr addr;

                 addr.s_addr = htonl(INADDR_ALLHOSTS_GROUP);
                 in_addmulti(&addr, ifp);
         }
+       splx(s);
         return (error);
  }


  /*
--------------------------------------------------------------------------------
Kind regards,
Jürgen

-- 
Jürgen Lambrecht
R&D Associate
Mobile: +32 499 644 531
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-27 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-27 11:24 RFC: bsd_tcp patch on in.c Lambrecht Jürgen
2013-06-27 13:43 ` Bernd Edlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).