1 diff -Nur busybox-1.01/include/usage.h busybox-1.01.openwrt/include/usage.h
2 --- busybox-1.01/include/usage.h 2005-08-17 03:29:15.000000000 +0200
3 +++ busybox-1.01.openwrt/include/usage.h 2005-10-20 11:01:34.000000000 +0200
5 "\t-n,\t--now\tExit with failure if lease cannot be immediately negotiated.\n" \
6 "\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
7 "\t-q,\t--quit\tQuit after obtaining lease\n" \
8 + "\t-R,\t--release\tRelease IP on quit\n" \
9 "\t-r,\t--request=IP\tIP address to request (default: none)\n" \
10 "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
11 "\t-v,\t--version\tDisplay version"
12 diff -Nur busybox-1.01/networking/udhcp/dhcpc.c busybox-1.01.openwrt/networking/udhcp/dhcpc.c
13 --- busybox-1.01/networking/udhcp/dhcpc.c 2005-08-17 03:29:10.000000000 +0200
14 +++ busybox-1.01.openwrt/networking/udhcp/dhcpc.c 2005-10-20 11:06:17.000000000 +0200
20 background_if_no_lease: 0,
24 " immediately negotiated.\n"
25 " -p, --pidfile=file Store process ID of daemon in file\n"
26 " -q, --quit Quit after obtaining lease\n"
27 +" -R, --release Release IP on quit\n"
28 " -r, --request=IP IP address to request (default: none)\n"
29 " -s, --script=file Run file at dhcp events (default:\n"
30 " " DEFAULT_SCRIPT ")\n"
32 {"now", no_argument, 0, 'n'},
33 {"pidfile", required_argument, 0, 'p'},
34 {"quit", no_argument, 0, 'q'},
35 + {"release", no_argument, 0, 'R'},
36 {"request", required_argument, 0, 'r'},
37 {"script", required_argument, 0, 's'},
38 {"version", no_argument, 0, 'v'},
43 - c = getopt_long(argc, argv, "c:CfbH:h:i:np:qr:s:v", arg_options, &option_index);
44 + c = getopt_long(argc, argv, "c:CfbH:h:i:np:qRr:s:v", arg_options, &option_index);
50 client_config.quit_after_lease = 1;
53 + client_config.release_on_quit = 1;
56 requested_ip = inet_addr(optarg);
61 change_mode(LISTEN_NONE);
62 - if (client_config.quit_after_lease)
63 + if (client_config.quit_after_lease) {
64 + if (client_config.release_on_quit)
68 if (!client_config.foreground)
79 LOG(LOG_INFO, "Received SIGTERM");
80 + if (!client_config.release_on_quit)
86 } else if (retval == -1 && errno == EINTR) {
87 /* a signal was caught */
88 diff -Nur busybox-1.01/networking/udhcp/dhcpc.h busybox-1.01.openwrt/networking/udhcp/dhcpc.h
89 --- busybox-1.01/networking/udhcp/dhcpc.h 2005-08-17 03:29:10.000000000 +0200
90 +++ busybox-1.01.openwrt/networking/udhcp/dhcpc.h 2005-10-20 11:01:44.000000000 +0200
92 struct client_config_t {
93 char foreground; /* Do not fork */
94 char quit_after_lease; /* Quit after obtaining lease */
95 + char release_on_quit; /* perform release on quit */
96 char abort_if_no_lease; /* Abort if no lease */
97 char background_if_no_lease; /* Fork to background if no lease */
98 char *interface; /* The name of the interface to use */