forked from Imagelibrary/rtems
2007-07-31 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1248/networking * libnetworking/rtems/rtems_glue.c: Luke Stras <luke@spacequest.com> reported that when no interfaces are successfully attached, the default route is broken and may result in a jump to an illegal address.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2007-07-31 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
PR 1248/networking
|
||||
* libnetworking/rtems/rtems_glue.c: Luke Stras <luke@spacequest.com>
|
||||
reported that when no interfaces are successfully attached, the
|
||||
default route is broken and may result in a jump to an illegal
|
||||
address.
|
||||
|
||||
2007-07-31 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* score/inline/rtems/score/priority.inl: Use size_t instead of
|
||||
|
||||
@@ -807,6 +807,7 @@ rtems_bsdnet_setup (void)
|
||||
struct sockaddr_in broadcast;
|
||||
struct sockaddr_in gateway;
|
||||
int i;
|
||||
int any_if_configured = 0;
|
||||
|
||||
/*
|
||||
* Set local parameters
|
||||
@@ -883,6 +884,9 @@ rtems_bsdnet_setup (void)
|
||||
printf ("Can't read %s flags: %s\n", ifp->name, strerror (errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
any_if_configured = 1;
|
||||
|
||||
if (flags & IFF_BROADCAST) {
|
||||
memset (&broadcast, '\0', sizeof broadcast);
|
||||
broadcast.sin_len = sizeof broadcast;
|
||||
@@ -904,7 +908,7 @@ rtems_bsdnet_setup (void)
|
||||
/*
|
||||
* Set default route
|
||||
*/
|
||||
if (rtems_bsdnet_config.gateway) {
|
||||
if (rtems_bsdnet_config.gateway && any_if_configured) {
|
||||
address.sin_addr.s_addr = INADDR_ANY;
|
||||
netmask.sin_addr.s_addr = INADDR_ANY;
|
||||
memset (&gateway, '\0', sizeof gateway);
|
||||
|
||||
Reference in New Issue
Block a user