← Commit list

06b543b21

Denis Vlasenko
Denis Vlasenko
2006-09-28
SOURCE BUG Duration: 100s

Subject

ifupdown: make dhcp start/stop scripts user configurable in /etc/network/interfaces. Patch author is Gabriel L. Somlo

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/ifupdown.c+16 -0
@@ -452,6 +452,14 @@ static int static_down(struct interface_defn_t *ifd, execfn *exec)
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
+ int i;
+
+ for (i = 0; i < ifd->n_options; i++) {
+ if (strcmp(ifd->option[i].name, "dhcp-start-cmd") == 0) {
+ return execute(ifd->option[i].value, ifd, exec);
+ }
+ }
+
if (execute("udhcpc -n -p /var/run/udhcpc.%iface%.pid -i "
"%iface% [[-H %hostname%]] [[-c %clientid%]]", ifd, exec)) return 1;
if (execute("pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]]", ifd, exec)) return 1;
@@ -463,6 +471,14 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
+ int i;
+
+ for (i = 0; i < ifd->n_options; i++) {
+ if (strcmp(ifd->option[i].name, "dhcp-stop-cmd") == 0) {
+ return execute(ifd->option[i].value, ifd, exec);
+ }
+ }
+
/* SIGUSR2 forces udhcpc to release the current lease and go inactive,
* and SIGTERM causes udhcpc to exit. Signals are queued and processed
* sequentially so we don't need to sleep */