Index: cpukit/libnetworking/nfs/bootp_subr.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libnetworking/nfs/bootp_subr.c,v
retrieving revision 1.22
diff -r1.22 bootp_subr.c
81c81
<  * The re-send loop count sup linearly to this maximum, so the
---
>  * The re-send loop counts up linearly to this maximum, so the
380,381c380
< 	timo = 0;
< 	for (;;) {
---
> 	for (timo=1; timo <= MAX_RESEND_DELAY; timo++) {
394d392
< 
398c396,408
< 			goto out;
---
>                         switch (error) {
>                         case  ENOBUFS:             /* No buffer space available */
>                         case  ENETUNREACH:         /* Network is unreachable */
>                         case  ENETDOWN:            /* Network interface is not configured */
>                         case  EHOSTDOWN:           /* Host is down */
>                         case  EHOSTUNREACH:        /* Host is unreachable */
>                         case  EMSGSIZE:            /* Message too long */
>                                 /* This is a possibly transient error.
>                                    We can still receive replies from previous attempts. */
>                                 break;
>                         default:
>                               goto out;
>                         }
401,407d410
< 		/* Determine new timeout. */
< 		if (timo < MAX_RESEND_DELAY)
< 			timo++;
< 		else
< 			printf("BOOTP timeout for server 0x%x\n",
< 			       (int)ntohl(sin->sin_addr.s_addr));
< 
457a461,463
>         printf("BOOTP timeout for server 0x%x\n",
>                (int)ntohl(sin->sin_addr.s_addr));
> 
485,486c491,494
<   if (error)
<     panic("bootpc_fakeup_interface: GIFFLAGS, error=%d", error);
---
>   if (error) {
>     printf("bootpc_fakeup_interface: GIFFLAGS, error=%s\n", strerror(error));
>     return error;
>   }
489,490c497,500
<   if (error)
<     panic("bootpc_fakeup_interface: SIFFLAGS, error=%d", error);
---
>   if (error) {
>     printf("bootpc_fakeup_interface: SIFFLAGS, error=%s\n", strerror(error));
>     return error;
>   }
496d505
<   
505,506c514,517
<   if (error)
<     panic("bootpc_fakeup_interface: set if addr, error=%d", error);
---
>   if (error) {
>     printf("bootpc_fakeup_interface: set if addr, error=%s\n", strerror(error));
>     return error;
>   }
516,517c527,530
<   if (error)
<     panic("bootpc_fakeup_interface: set if net addr, error=%d", error);
---
>   if (error) {
>     printf("bootpc_fakeup_interface: set if netmask, error=%s\n", strerror(error));
>     return error;
>   }
527,528c540,544
<   if (error)
<     panic("bootpc_fakeup_interface: set if broadcast addr, error=%d", error);
---
>   if (error) {
>     printf("bootpc_fakeup_interface: set broadcast addr, error=%s\n", strerror(error));
>     return error;
>   }
>   
604,605c620,623
<   if (error)
<     panic("nfs_boot: set if netmask, error=%d", error);
---
>   if (error) {
>     printf("bootpc_adjust_interface: set netmask, error=%s\n", strerror(error));
>     return error;
>   }
615,616c633,636
<   if (error)
<     panic("bootpc_call: set if broadcast addr, error=%d", error);
---
>   if (error) {
>     printf("bootpc_adjust_interface: set broadcast addr, error=%s\n", strerror(error));
>     return error;
>   }
620,621c640,643
<   if (error)
<     panic("nfs_boot: set if addr, error=%d", error);
---
>   if (error) {
>     printf("bootpc_adjust_interface: set if addr, error=%s\n", strerror(error));
>     return error;
>   }
631,632c653
<     printf("nfs_boot: add net route, error=%d\n", error);
<     return error;
---
>     printf("bootpc_adjust_interface: add net route, error=%d\n", error);
635c656
<   return 0;
---
>   return error;
761,762c782,785
<       if (len!=4) 
<         panic("bootpc: subnet mask len is %d",len);
---
>       if (len!=4) {
>         printf("bootpc: subnet mask len is %d\n",len);
>         continue;
>       }
769,770c792,795
<       if (len!=4) 
<         panic("bootpc: time offset len is %d",len);
---
>       if (len!=4) {
>         printf("bootpc: time offset len is %d\n",len);
>         continue;
>       }
777,778c802,805
<       if (len % 4) 
<         panic ("bootpc: Router Len is %d", len);
---
>       if (len % 4) {
>         printf ("bootpc: Router Len is %d\n", len);
>         continue;
>       }
787,788c814,817
<       if (len % 4) 
<         panic ("bootpc: time server Len is %d", len);
---
>       if (len % 4) {
>         printf ("bootpc: time server Len is %d\n", len);
>         continue;
>       }
807,808c836,839
<       if (len % 4) 
<         panic ("bootpc: DNS Len is %d", len);
---
>       if (len % 4) {
>         printf ("bootpc: DNS Len is %d", len);
>         continue;
>       }
827,830c858,864
<       if (len>=MAXHOSTNAMELEN)
<         panic ("bootpc: hostname >=%d bytes", MAXHOSTNAMELEN);
<       if (sethostname ((char *)p, len) < 0)
<         panic("Can't set host name");
---
>       if (len>=MAXHOSTNAMELEN) {
>         printf ("bootpc: hostname >=%d bytes", MAXHOSTNAMELEN);
>         continue;
>       }
>       if (sethostname ((char *)p, len) < 0) {
>         printf("bootpc: Can't set host name");
>       }
837,838c871,874
<       if (len % 4) 
<         panic ("bootpc: Log server Len is %d", len);
---
>       if (len % 4) {
>         printf ("bootpc: Log server Len is %d", len);
>         continue;
>       }
859,860c895,898
<       if (len != 1) 
<         panic ("bootpc: DHCP option overload len is %d", len);
---
>       if (len != 1) {
>         printf ("bootpc: DHCP option overload len is %d", len);
>         continue;
>       }
875,876c913,916
<       if (len != 4) 
<         panic ("bootpc: DHCP server len is %d", len);
---
>       if (len != 4) {
>         printf ("bootpc: DHCP server len is %d", len);
>         continue;
>       }
958,959c998,1001
<   if (ifp == NULL)
<     panic("bootpc_init: no suitable interface");
---
>   if (ifp == NULL) {
>     printf("bootpc_init: no suitable interface\n");
>     return;
>   }
965,968c1007,1013
<   if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0)
<     panic("nfs_boot: socreate, error=%d", error);
< 	  
<   bootpc_fakeup_interface(&ireq,so,procp);
---
>   if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0,procp)) != 0) {
>     printf("bootpc_init: socreate, error=%d", error);
>     return;
>   }
>   if (bootpc_fakeup_interface(&ireq,so,procp) != 0) {
>     return;
>   }
970,971d1014
<   printf("Bootpc testing starting\n");
<   
980,984c1023,1031
<   if (!sdl)
<     panic("bootpc: Unable to find HW address");
<   if (sdl->sdl_alen != EALEN ) 
<     panic("bootpc: HW address len is %d, expected value is %d",
< 	  sdl->sdl_alen,EALEN);
---
>   if (!sdl) {
>     printf("bootpc: Unable to find HW address\n");
>     return;
>   }
>   if (sdl->sdl_alen != EALEN ) {
>     printf("bootpc: HW address len is %d, expected value is %d\n",
> 	   sdl->sdl_alen,EALEN);
>     return;
>   }
1021,1022c1068,1071
<   if (error)
<     panic("BOOTP call failed -- error %d", error);
---
>   if (error) {
>     printf("BOOTP call failed -- error %d", error);
>     return;
>   }
Index: cpukit/libnetworking/rtems/dhcp.h
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libnetworking/rtems/dhcp.h,v
retrieving revision 1.1
diff -r1.1 dhcp.h
31a32,33
> int rtems_bsdnet_do_dhcp_timeout (void);
> void rtems_bsdnet_dhcp_down (void);
Index: cpukit/libnetworking/rtems/rtems_dhcp.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libnetworking/rtems/rtems_dhcp.c,v
retrieving revision 1.1
diff -r1.1 rtems_dhcp.c
12a13,18
>  * Added interface to terminate DHCP task, and removed panics.
>  * Arnout Vandecappelle <arnout@mind.be>, Essensium/Mind
>  * Maarten Van Es <maarten@mind.be>, Essensium/Mind
>  */
> 
> /*
189d194
< extern int nfs_diskless_valid;
273a279,280
>   dhcp_message_type = 0;
> 
306,307c313,316
<         if (len != 4)
<           panic ("dhcpc: subnet mask len is %d", len);
---
>         if (len != 4) {
>           printf ("dhcpc: subnet mask len is %d\n", len);
>           continue;
>         }
314,315c323,326
<         if (len != 4)
<           panic ("dhcpc: time offset len is %d", len);
---
>         if (len != 4) {
>           printf ("dhcpc: time offset len is %d\n", len);
>           continue;
>         }
322,323c333,336
<         if (len % 4)
<           panic ("dhcpc: Router Len is %d", len);
---
>         if (len % 4) {
>           printf ("dhcpc: Router Len is %d\n", len);
>           continue;
>         }
333,334c346,349
<         if (len % 4)
<           panic ("dhcpc: time server Len is %d", len);
---
>         if (len % 4) {
>           printf ("dhcpc: time server Len is %d\n", len);
>           continue;
>         }
352,353c367,370
<         if (len % 4)
<           panic ("dhcpc: DNS Len is %d", len);
---
>         if (len % 4) {
>           printf ("dhcpc: DNS Len is %d\n", len);
>           continue;
>         }
371,372c388,391
<         if (len >= MAXHOSTNAMELEN)
<           panic ("dhcpc: hostname >= %d bytes", MAXHOSTNAMELEN);
---
>         if (len >= MAXHOSTNAMELEN) {
>           printf ("dhcpc: hostname >= %d bytes\n", MAXHOSTNAMELEN);
>           len = MAXHOSTNAMELEN-1;
>         }
374c393
<           panic ("dhcpc: can't set host name");
---
>           printf ("dhcpc: can't set host name");
386,387c405,408
<         if (len % 4)
<           panic ("dhcpc: Log server Len is %d", len);
---
>         if (len % 4) {
>           printf ("dhcpc: Log server Len is %d\n", len);
>           continue;
>         }
409c430
<           panic ("dhcpc: DHCP option requested IP len is %d", len);
---
>           printf ("dhcpc: DHCP option requested IP len is %d", len);
419,420c440,443
<         if (len != 4)
<           panic ("dhcpc: DHCP option lease-length len is %d", len);
---
>         if (len != 4) {
>           printf ("dhcpc: DHCP option lease-length len is %d", len);
>           continue;
>         }
427,428c450,453
<         if (len != 1)
<           panic ("dhcpc: DHCP option overload len is %d", len);
---
>         if (len != 1) {
>           printf ("dhcpc: DHCP option overload len is %d", len);
>           continue;
>         }
434,435c459,462
<         if (len != 1)
<           panic ("dhcpc: DHCP message len is %d", len);
---
>         if (len != 1) {
>           printf ("dhcpc: DHCP message len is %d", len);
>           continue;
>         }
450,451c477,480
<         if (len != 4)
<           panic ("dhcpc: DHCP server len is %d", len);
---
>         if (len != 4) {
>           printf ("dhcpc: DHCP server len is %d", len);
>           continue;
>         }
649c678
< static rtems_id           dhcp_task_id;
---
> static rtems_id           dhcp_task_id = 0;
669a699
>   int                 disconnected;
674c704,706
<   
---
>   disconnected = 0;
>  
> 
676a709,720
>     /*
>      * Sleep until the next poll
>      */
>     timeout = TOD_MILLISECONDS_TO_TICKS (1000);
>     rtems_event_receive (RTEMS_EVENT_0,
>                          RTEMS_WAIT | RTEMS_EVENT_ANY,
>                          timeout, &event_out);
> 
>     if(event_out & RTEMS_EVENT_0) break;
> 
>     count++;
> 
687,690c731,736
<       
<       if (error)
<         panic ("DHCP call failed -- error %d", error);
<       
---
>       if (error) {
>         rtems_bsdnet_semaphore_release ();
>         printf ("DHCP call failed -- error %d", error);
>         continue;
>       }
> 
699c745,746
<         panic ("DHCP server did not send Magic Cookie.\n");
---
>         printf ("DHCP server did not send Magic Cookie.\n");
>         continue;
707c754,755
<         panic ("DHCP server did not accept the DHCP request");
---
>         printf ("DHCP server did not accept the DHCP request");
>         continue;
714,722d761
< 
<     /*
<      * Sleep until the next poll
<      */
<     timeout = TOD_MILLISECONDS_TO_TICKS (1000);
<     rtems_event_receive (RTEMS_EVENT_0,
<                          RTEMS_WAIT | RTEMS_EVENT_ANY,
<                          timeout, &event_out);
<     count++;
723a763,768
> 
> 
>   dhcp_task_id = 0;
>   printf ("dhcpc: exiting lease renewal task.\n");
>   rtems_task_delete( RTEMS_SELF);
> 
797a843,846
>  *
>  *    return value:
>  *    0: ok
>  *    < 0: failed to startup or configure interface
799c848
< void
---
> int
814,819d862
<   
<   /*
<    * If already filled in, don't touch it here 
<    */
<   if (nfs_diskless_valid)
<     return;
837,838c880,884
<   if (ifp == NULL)
<     panic ("dhcpc_init: no suitable interface");
---
>   if (ifp == NULL){
>     printf ("dhcpc_init: no suitable interface\n");
>     return -1;
>   }
> 
842,843c888,891
<   if ((error = socreate (AF_INET, &so, SOCK_DGRAM, 0, procp)) != 0)
<     panic ("nfs_boot: socreate, error=%d", error);
---
>   if ((error = socreate (AF_INET, &so, SOCK_DGRAM, 0, procp)) != 0) {
>     printf ("dhcpc_init: socreate, error=%d\n", error);
>     return -1;
>   }
857,860c905,910
<   if (!sdl)
<     panic ("dhcpc: Unable to find HW address");
<   if (sdl->sdl_alen != EALEN)
<     panic ("dhcpc: HW address len is %d, expected value is %d",
---
>   if (!sdl){
>     printf ("dhcpc_init: Unable to find HW address\n");
>     return -1;
>   }
>   if (sdl->sdl_alen != EALEN) {
>     printf ("dhcpc_init: HW address len is %d, expected value is %d\n",
861a912,913
>     return -1;
>   }
872,873c924,927
<   if (error)
<     panic ("BOOTP call failed -- error %d", error);
---
>   if (error) {
>     printf ("BOOTP call failed -- error %d\n", error);
>     return -1;
>   }
878,879c932,935
<   if (memcmp (&reply.vend[0], dhcp_magic_cookie, sizeof (dhcp_magic_cookie)) != 0)
<     panic ("DHCP server did not send Magic Cookie.\n");
---
>   if (memcmp (&reply.vend[0], dhcp_magic_cookie, sizeof (dhcp_magic_cookie)) != 0) {
>     printf ("DHCP server did not send Magic Cookie.\n");
>     return -1;
>   }
883,884c939,942
<   if (dhcp_message_type != DHCP_OFFER)
<     panic ("DHCP server did not send a DHCP Offer.\n");
---
>   if (dhcp_message_type != DHCP_OFFER) {
>     printf ("DHCP server did not send a DHCP Offer.\n");
>     return -1;
>   }
892,893c950,953
<   if (error)
<     panic ("BOOTP call failed -- error %d", error);
---
>   if (error) {
>     printf ("BOOTP call failed -- error %d\n", error);
>     return -1;
>   }
898,899c958,961
<   if (memcmp (&reply.vend[0], dhcp_magic_cookie, sizeof (dhcp_magic_cookie)) != 0)
<     panic ("DHCP server did not send Magic Cookie.\n");
---
>   if (memcmp (&reply.vend[0], dhcp_magic_cookie, sizeof (dhcp_magic_cookie)) != 0) {
>     printf ("DHCP server did not send Magic Cookie.\n");
>     return -1;
>   }
903,904c965,968
<   if (dhcp_message_type != DHCP_ACK)
<     panic ("DHCP server did not accept the DHCP request");
---
>   if (dhcp_message_type != DHCP_ACK) {
>     printf ("DHCP server did not accept the DHCP request\n");
>     return -1;
>   }
1041a1106,1107
> 
>   return 0;
1052c1118,1122
<   dhcp_init (TRUE);
---
>   while( dhcp_init (TRUE) < 0 ) {
>     rtems_bsdnet_semaphore_release();
>     rtems_task_wake_after(TOD_MILLISECONDS_TO_TICKS(1000));
>     rtems_bsdnet_semaphore_obtain ();
>   }
1055a1126,1143
> int rtems_bsdnet_do_dhcp_timeout( void )
> {
>   int return_value;
> 
>   rtems_bsdnet_semaphore_obtain ();
>   return_value = dhcp_init (FALSE);
>   rtems_bsdnet_semaphore_release ();
> 
>   return return_value;
> }
> 
> void rtems_bsdnet_dhcp_down (void)
> {
>    if(dhcp_task_id != 0) {
>      rtems_event_send (dhcp_task_id, RTEMS_EVENT_0);
>    }
> }
> 
1095,1096c1183,1186
<   if (!match)
<     panic ("dhcpc: no matching interface");
---
>   if (!match) {
>     printf ("dhcpc: no matching interface\n");
>     return;
>   }
1104,1105c1194,1197
<   if (!match)
<     panic ("dhcpc: no matching interface");
---
>   if (!match) {
>     printf ("dhcpc: no matching interface address\n");
>     return;
>   }
Index: cpukit/libnetworking/rtems/rtems_glue.c
===================================================================
RCS file: /usr1/CVS/rtems/cpukit/libnetworking/rtems/rtems_glue.c,v
retrieving revision 1.47
diff -r1.47 rtems_glue.c
1130c1130
< 			r = ioctl(s, cmd, (struct freq *) param);
---
> 			r = ioctl(s, cmd, (struct ifreq *) param);
