diff options
Diffstat (limited to 'networking/udhcp/dhcpc.c')
-rw-r--r-- | networking/udhcp/dhcpc.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index e2fb18aba..0e673ae7e 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c | |||
@@ -730,7 +730,7 @@ static NOINLINE int send_discover(uint32_t xid, uint32_t requested) | |||
730 | */ | 730 | */ |
731 | add_client_options(&packet); | 731 | add_client_options(&packet); |
732 | 732 | ||
733 | bb_error_msg("sending %s", "discover"); | 733 | bb_info_msg("sending %s", "discover"); |
734 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); | 734 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); |
735 | } | 735 | } |
736 | 736 | ||
@@ -774,7 +774,7 @@ static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requeste | |||
774 | add_client_options(&packet); | 774 | add_client_options(&packet); |
775 | 775 | ||
776 | temp_addr.s_addr = requested; | 776 | temp_addr.s_addr = requested; |
777 | bb_error_msg("sending select for %s", inet_ntoa(temp_addr)); | 777 | bb_info_msg("sending select for %s", inet_ntoa(temp_addr)); |
778 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); | 778 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); |
779 | } | 779 | } |
780 | 780 | ||
@@ -815,7 +815,7 @@ static NOINLINE int send_renew(uint32_t xid, uint32_t server, uint32_t ciaddr) | |||
815 | add_client_options(&packet); | 815 | add_client_options(&packet); |
816 | 816 | ||
817 | temp_addr.s_addr = server; | 817 | temp_addr.s_addr = server; |
818 | bb_error_msg("sending renew to %s", inet_ntoa(temp_addr)); | 818 | bb_info_msg("sending renew to %s", inet_ntoa(temp_addr)); |
819 | return bcast_or_ucast(&packet, ciaddr, server); | 819 | return bcast_or_ucast(&packet, ciaddr, server); |
820 | } | 820 | } |
821 | 821 | ||
@@ -844,7 +844,7 @@ static NOINLINE int send_decline(/*uint32_t xid,*/ uint32_t server, uint32_t req | |||
844 | 844 | ||
845 | udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); | 845 | udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); |
846 | 846 | ||
847 | bb_error_msg("sending %s", "decline"); | 847 | bb_info_msg("sending %s", "decline"); |
848 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); | 848 | return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY); |
849 | } | 849 | } |
850 | #endif | 850 | #endif |
@@ -866,7 +866,7 @@ int send_release(uint32_t server, uint32_t ciaddr) | |||
866 | 866 | ||
867 | udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); | 867 | udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); |
868 | 868 | ||
869 | bb_error_msg("sending %s", "release"); | 869 | bb_info_msg("sending %s", "release"); |
870 | /* Note: normally we unicast here since "server" is not zero. | 870 | /* Note: normally we unicast here since "server" is not zero. |
871 | * However, there _are_ people who run "address-less" DHCP servers, | 871 | * However, there _are_ people who run "address-less" DHCP servers, |
872 | * and reportedly ISC dhcp client and Windows allow that. | 872 | * and reportedly ISC dhcp client and Windows allow that. |
@@ -969,7 +969,7 @@ static NOINLINE int udhcp_recv_raw_packet(struct dhcp_packet *dhcp_pkt, int fd) | |||
969 | skip_udp_sum_check: | 969 | skip_udp_sum_check: |
970 | 970 | ||
971 | if (packet.data.cookie != htonl(DHCP_MAGIC)) { | 971 | if (packet.data.cookie != htonl(DHCP_MAGIC)) { |
972 | bb_error_msg("packet with bad magic, ignoring"); | 972 | bb_info_msg("packet with bad magic, ignoring"); |
973 | return -2; | 973 | return -2; |
974 | } | 974 | } |
975 | 975 | ||
@@ -1117,7 +1117,7 @@ static void change_listen_mode(int new_mode) | |||
1117 | /* Called only on SIGUSR1 */ | 1117 | /* Called only on SIGUSR1 */ |
1118 | static void perform_renew(void) | 1118 | static void perform_renew(void) |
1119 | { | 1119 | { |
1120 | bb_error_msg("performing DHCP renew"); | 1120 | bb_info_msg("performing DHCP renew"); |
1121 | switch (state) { | 1121 | switch (state) { |
1122 | case BOUND: | 1122 | case BOUND: |
1123 | change_listen_mode(LISTEN_KERNEL); | 1123 | change_listen_mode(LISTEN_KERNEL); |
@@ -1151,11 +1151,11 @@ static void perform_release(uint32_t server_addr, uint32_t requested_ip) | |||
1151 | temp_addr.s_addr = server_addr; | 1151 | temp_addr.s_addr = server_addr; |
1152 | strcpy(buffer, inet_ntoa(temp_addr)); | 1152 | strcpy(buffer, inet_ntoa(temp_addr)); |
1153 | temp_addr.s_addr = requested_ip; | 1153 | temp_addr.s_addr = requested_ip; |
1154 | bb_error_msg("unicasting a release of %s to %s", | 1154 | bb_info_msg("unicasting a release of %s to %s", |
1155 | inet_ntoa(temp_addr), buffer); | 1155 | inet_ntoa(temp_addr), buffer); |
1156 | send_release(server_addr, requested_ip); /* unicast */ | 1156 | send_release(server_addr, requested_ip); /* unicast */ |
1157 | } | 1157 | } |
1158 | bb_error_msg("entering released state"); | 1158 | bb_info_msg("entering released state"); |
1159 | /* | 1159 | /* |
1160 | * We can be here on: SIGUSR2, | 1160 | * We can be here on: SIGUSR2, |
1161 | * or on exit (SIGTERM) and -R "release on quit" is specified. | 1161 | * or on exit (SIGTERM) and -R "release on quit" is specified. |
@@ -1391,7 +1391,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1391 | /* Create pidfile */ | 1391 | /* Create pidfile */ |
1392 | write_pidfile(client_config.pidfile); | 1392 | write_pidfile(client_config.pidfile); |
1393 | /* Goes to stdout (unless NOMMU) and possibly syslog */ | 1393 | /* Goes to stdout (unless NOMMU) and possibly syslog */ |
1394 | bb_error_msg("started, v"BB_VER); | 1394 | bb_info_msg("started, v"BB_VER); |
1395 | /* Set up the signal pipe */ | 1395 | /* Set up the signal pipe */ |
1396 | udhcp_sp_setup(); | 1396 | udhcp_sp_setup(); |
1397 | /* We want random_xid to be random... */ | 1397 | /* We want random_xid to be random... */ |
@@ -1481,7 +1481,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1481 | udhcp_run_script(NULL, "leasefail"); | 1481 | udhcp_run_script(NULL, "leasefail"); |
1482 | #if BB_MMU /* -b is not supported on NOMMU */ | 1482 | #if BB_MMU /* -b is not supported on NOMMU */ |
1483 | if (opt & OPT_b) { /* background if no lease */ | 1483 | if (opt & OPT_b) { /* background if no lease */ |
1484 | bb_error_msg("no lease, forking to background"); | 1484 | bb_info_msg("no lease, forking to background"); |
1485 | client_background(); | 1485 | client_background(); |
1486 | /* do not background again! */ | 1486 | /* do not background again! */ |
1487 | opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); | 1487 | opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f); |
@@ -1494,7 +1494,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1494 | } else | 1494 | } else |
1495 | #endif | 1495 | #endif |
1496 | if (opt & OPT_n) { /* abort if no lease */ | 1496 | if (opt & OPT_n) { /* abort if no lease */ |
1497 | bb_error_msg("no lease, failing"); | 1497 | bb_info_msg("no lease, failing"); |
1498 | retval = 1; | 1498 | retval = 1; |
1499 | goto ret; | 1499 | goto ret; |
1500 | } | 1500 | } |
@@ -1570,7 +1570,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1570 | continue; | 1570 | continue; |
1571 | } | 1571 | } |
1572 | /* Timed out, enter init state */ | 1572 | /* Timed out, enter init state */ |
1573 | bb_error_msg("lease lost, entering init state"); | 1573 | bb_info_msg("lease lost, entering init state"); |
1574 | udhcp_run_script(NULL, "deconfig"); | 1574 | udhcp_run_script(NULL, "deconfig"); |
1575 | state = INIT_SELECTING; | 1575 | state = INIT_SELECTING; |
1576 | client_config.first_secs = 0; /* make secs field count from 0 */ | 1576 | client_config.first_secs = 0; /* make secs field count from 0 */ |
@@ -1615,7 +1615,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1615 | timeout = INT_MAX; | 1615 | timeout = INT_MAX; |
1616 | continue; | 1616 | continue; |
1617 | case SIGTERM: | 1617 | case SIGTERM: |
1618 | bb_error_msg("received %s", "SIGTERM"); | 1618 | bb_info_msg("received %s", "SIGTERM"); |
1619 | goto ret0; | 1619 | goto ret0; |
1620 | } | 1620 | } |
1621 | 1621 | ||
@@ -1662,7 +1662,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1662 | 1662 | ||
1663 | message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); | 1663 | message = udhcp_get_option(&packet, DHCP_MESSAGE_TYPE); |
1664 | if (message == NULL) { | 1664 | if (message == NULL) { |
1665 | bb_error_msg("no message type option, ignoring packet"); | 1665 | bb_info_msg("no message type option, ignoring packet"); |
1666 | continue; | 1666 | continue; |
1667 | } | 1667 | } |
1668 | 1668 | ||
@@ -1691,7 +1691,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1691 | * might work too. | 1691 | * might work too. |
1692 | * "Next server" and router are definitely wrong ones to use, though... | 1692 | * "Next server" and router are definitely wrong ones to use, though... |
1693 | */ | 1693 | */ |
1694 | /* We used to ignore pcakets without DHCP_SERVER_ID. | 1694 | /* We used to ignore packets without DHCP_SERVER_ID. |
1695 | * I've got user reports from people who run "address-less" servers. | 1695 | * I've got user reports from people who run "address-less" servers. |
1696 | * They either supply DHCP_SERVER_ID of 0.0.0.0 or don't supply it at all. | 1696 | * They either supply DHCP_SERVER_ID of 0.0.0.0 or don't supply it at all. |
1697 | * They say ISC DHCP client supports this case. | 1697 | * They say ISC DHCP client supports this case. |
@@ -1699,7 +1699,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1699 | server_addr = 0; | 1699 | server_addr = 0; |
1700 | temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); | 1700 | temp = udhcp_get_option32(&packet, DHCP_SERVER_ID); |
1701 | if (!temp) { | 1701 | if (!temp) { |
1702 | bb_error_msg("no server ID, using 0.0.0.0"); | 1702 | bb_info_msg("no server ID, using 0.0.0.0"); |
1703 | } else { | 1703 | } else { |
1704 | /* it IS unaligned sometimes, don't "optimize" */ | 1704 | /* it IS unaligned sometimes, don't "optimize" */ |
1705 | move_from_unaligned32(server_addr, temp); | 1705 | move_from_unaligned32(server_addr, temp); |
@@ -1726,7 +1726,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1726 | 1726 | ||
1727 | temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME); | 1727 | temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME); |
1728 | if (!temp) { | 1728 | if (!temp) { |
1729 | bb_error_msg("no lease time with ACK, using 1 hour lease"); | 1729 | bb_info_msg("no lease time with ACK, using 1 hour lease"); |
1730 | lease_seconds = 60 * 60; | 1730 | lease_seconds = 60 * 60; |
1731 | } else { | 1731 | } else { |
1732 | /* it IS unaligned sometimes, don't "optimize" */ | 1732 | /* it IS unaligned sometimes, don't "optimize" */ |
@@ -1759,7 +1759,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1759 | client_config.interface, | 1759 | client_config.interface, |
1760 | arpping_ms) | 1760 | arpping_ms) |
1761 | ) { | 1761 | ) { |
1762 | bb_error_msg("offered address is in use " | 1762 | bb_info_msg("offered address is in use " |
1763 | "(got ARP reply), declining"); | 1763 | "(got ARP reply), declining"); |
1764 | send_decline(/*xid,*/ server_addr, packet.yiaddr); | 1764 | send_decline(/*xid,*/ server_addr, packet.yiaddr); |
1765 | 1765 | ||
@@ -1778,7 +1778,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1778 | #endif | 1778 | #endif |
1779 | /* enter bound state */ | 1779 | /* enter bound state */ |
1780 | temp_addr.s_addr = packet.yiaddr; | 1780 | temp_addr.s_addr = packet.yiaddr; |
1781 | bb_error_msg("lease of %s obtained, lease time %u", | 1781 | bb_info_msg("lease of %s obtained, lease time %u", |
1782 | inet_ntoa(temp_addr), (unsigned)lease_seconds); | 1782 | inet_ntoa(temp_addr), (unsigned)lease_seconds); |
1783 | requested_ip = packet.yiaddr; | 1783 | requested_ip = packet.yiaddr; |
1784 | 1784 | ||
@@ -1831,7 +1831,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | |||
1831 | goto non_matching_svid; | 1831 | goto non_matching_svid; |
1832 | } | 1832 | } |
1833 | /* return to init state */ | 1833 | /* return to init state */ |
1834 | bb_error_msg("received %s", "DHCP NAK"); | 1834 | bb_info_msg("received %s", "DHCP NAK"); |
1835 | udhcp_run_script(&packet, "nak"); | 1835 | udhcp_run_script(&packet, "nak"); |
1836 | if (state != REQUESTING) | 1836 | if (state != REQUESTING) |
1837 | udhcp_run_script(NULL, "deconfig"); | 1837 | udhcp_run_script(NULL, "deconfig"); |