This is the mail archive of the ecos-devel@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: bsd_tcp patch on in.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]