diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-05-14 14:28:38 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-05-14 14:28:38 +0000 |
commit | fe3955bc093ba12a87e999ab56670bb7fb9752a5 (patch) | |
tree | 89c0273d42b1013176c71cfbb826ece5c0172c91 | |
parent | 2e118e2083cb17011be0ab05490d803130c7c061 (diff) | |
download | drakx-fe3955bc093ba12a87e999ab56670bb7fb9752a5.tar drakx-fe3955bc093ba12a87e999ab56670bb7fb9752a5.tar.gz drakx-fe3955bc093ba12a87e999ab56670bb7fb9752a5.tar.bz2 drakx-fe3955bc093ba12a87e999ab56670bb7fb9752a5.tar.xz drakx-fe3955bc093ba12a87e999ab56670bb7fb9752a5.zip |
- add a sleep(2) after ioctl ifupping so that further operation can work normally
- more logs
-rw-r--r-- | mdk-stage1/dhcp.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c index b886ae3aa..9edae172d 100644 --- a/mdk-stage1/dhcp.c +++ b/mdk-stage1/dhcp.c @@ -174,6 +174,10 @@ static int initial_setup_interface(char * device, int s) { return -1; } + /* I need to sleep a bit in order for kernel to finish init of the + network device */ + sleep(2); + return 0; } @@ -215,26 +219,32 @@ static void parse_reply(struct bootp_request * breq, struct interface_info * int case BOOTP_OPTION_DNS: memcpy(&dns_server, chptr, sizeof(dns_server)); log_message("got dns %s", inet_ntoa(dns_server)); - if (length >= sizeof(dns_server)*2) + if (length >= sizeof(dns_server)*2) { memcpy(&dns_server2, chptr+sizeof(dns_server), sizeof(dns_server2)); + log_message("got dns2 %s", inet_ntoa(dns_server2)); + } break; case BOOTP_OPTION_NETMASK: - memcpy(&intf->netmask, chptr, 4); + memcpy(&intf->netmask, chptr, sizeof(intf->netmask)); + log_message("got netmask %s", inet_ntoa(intf->netmask)); break; case BOOTP_OPTION_DOMAIN: memcpy(tmp_str, chptr, length); tmp_str[length] = '\0'; domain = strdup(tmp_str); + log_message("got domain %s", domain); break; case BOOTP_OPTION_BROADCAST: - memcpy(&intf->broadcast, chptr, 4); + memcpy(&intf->broadcast, chptr, sizeof(intf->broadcast)); + log_message("got broadcast %s", inet_ntoa(intf->broadcast)); break; case BOOTP_OPTION_GATEWAY: - memcpy(&gateway, chptr, 4); + memcpy(&gateway, chptr, sizeof(gateway)); + log_message("got gateway %s", inet_ntoa(gateway)); break; case BOOTP_OPTION_HOSTNAME: |