- memset ( &dhcp, 0, sizeof ( dhcp ) );
- dhcp.netdev = netdev;
- if ( ( rc = async_block ( &async,
- start_dhcp ( &dhcp, &async ) ) ) != 0 ) {
- printf ( "failed (%s)\n", strerror ( rc ) );
- return rc;
- }
- printf ( "done\n" );
-
- /* Store and register options */
- dhcp_options = dhcp.options;
- register_dhcp_options ( dhcp_options );
-
- /* Retrieve IP address configuration */
- find_dhcp_ipv4_option ( dhcp_options, DHCP_EB_YIADDR, &address );
- find_dhcp_ipv4_option ( dhcp_options, DHCP_SUBNET_MASK, &netmask );
- find_dhcp_ipv4_option ( dhcp_options, DHCP_ROUTERS, &gateway );