--- networking/udhcp/dhcpc.c.orig 2004-05-19 04:29:05.000000000 -0400 +++ networking/udhcp/dhcpc.c 2007-06-04 17:58:55.000000000 -0400 @@ -82,6 +82,7 @@ static void __attribute__ ((noreturn)) s " -f, --foreground Do not fork after getting lease\n" " -b, --background Fork to background if lease cannot be\n" " immediately negotiated.\n" +" -B, Background Immediately.\n" " -i, --interface=INTERFACE Interface to use (default: eth0)\n" " -n, --now Exit with failure if lease cannot be\n" " immediately negotiated.\n" @@ -191,6 +192,7 @@ int main(int argc, char *argv[]) long now; int max_fd; int sig; + int backgrounding = 0; static const struct option arg_options[] = { {"clientid", required_argument, 0, 'c'}, @@ -211,7 +213,7 @@ int main(int argc, char *argv[]) /* get options */ while (1) { int option_index = 0; - c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index); + c = getopt_long(argc, argv, "c:fbBH:h:i:np:qr:s:v", arg_options, &option_index); if (c == -1) break; switch (c) { @@ -225,11 +227,19 @@ int main(int argc, char *argv[]) strncpy(client_config.clientid + OPT_DATA, optarg, len); break; case 'f': + if( backgrounding == 1 ) break; client_config.foreground = 1; break; case 'b': + if( backgrounding == 1 ) break; client_config.background_if_no_lease = 1; break; + case 'B': + if( backgrounding == 1 ) break; + LOG(LOG_INFO,"Backgrounding before lease"); + client_background(); + backgrounding = 1; + break; case 'h': case 'H': len = strlen(optarg) > 255 ? 255 : strlen(optarg);