Merge commit 'ddd36a90fca6ccd48e9981308e71e99aa976ce91' into dora
This commit is contained in:
commit
2a79140b6d
|
@ -2,7 +2,51 @@ Index: ifupdown-0.7.52/execute.c
|
|||
===================================================================
|
||||
--- ifupdown-0.7.52.orig/execute.c
|
||||
+++ ifupdown-0.7.52/execute.c
|
||||
@@ -168,8 +168,7 @@ int execute_scripts(interface_defn * ifd
|
||||
@@ -25,7 +25,7 @@ static void set_environ(interface_defn *
|
||||
{
|
||||
char **environend;
|
||||
int i;
|
||||
- const int n_env_entries = iface->n_options + 8;
|
||||
+ const int n_env_entries = (iface ? iface->n_options : 0) + 8;
|
||||
|
||||
{
|
||||
char **ppch;
|
||||
@@ -42,7 +42,7 @@ static void set_environ(interface_defn *
|
||||
environend = environ;
|
||||
*environend = NULL;
|
||||
|
||||
- for (i = 0; i < iface->n_options; i++) {
|
||||
+ for (i = 0; iface && i < iface->n_options; i++) {
|
||||
if (strcmp(iface->option[i].name, "pre-up") == 0 || strcmp(iface->option[i].name, "up") == 0 || strcmp(iface->option[i].name, "down") == 0 || strcmp(iface->option[i].name, "post-down") == 0) {
|
||||
continue;
|
||||
}
|
||||
@@ -52,6 +52,7 @@ static void set_environ(interface_defn *
|
||||
*environend = NULL;
|
||||
}
|
||||
|
||||
+ if (iface) {
|
||||
*(environend++) = setlocalenv("%s=%s", "IFACE", iface->real_iface);
|
||||
*environend = NULL;
|
||||
|
||||
@@ -63,12 +64,17 @@ static void set_environ(interface_defn *
|
||||
|
||||
*(environend++) = setlocalenv("%s=%s", "METHOD", iface->method->name);
|
||||
*environend = NULL;
|
||||
+ }
|
||||
|
||||
+ if (mode) {
|
||||
*(environend++) = setlocalenv("%s=%s", "MODE", mode);
|
||||
*environend = NULL;
|
||||
+ }
|
||||
|
||||
+ if (phase) {
|
||||
*(environend++) = setlocalenv("%s=%s", "PHASE", phase);
|
||||
*environend = NULL;
|
||||
+ }
|
||||
|
||||
*(environend++) = setlocalenv("%s=%s", "VERBOSITY", verbose ? "1" : "0");
|
||||
*environend = NULL;
|
||||
@@ -168,8 +174,7 @@ int execute_scripts(interface_defn * ifd
|
||||
return 1;
|
||||
|
||||
char buf[100];
|
||||
|
@ -12,3 +56,15 @@ Index: ifupdown-0.7.52/execute.c
|
|||
verbose ? "--verbose " : "", opt);
|
||||
|
||||
int result = (*exec)(buf);
|
||||
@@ -285,6 +290,11 @@ int execute(char *command, interface_def
|
||||
char *out;
|
||||
int ret;
|
||||
|
||||
+ if (!environ) {
|
||||
+ /* initialize the environment to find /sbin/ip */
|
||||
+ set_environ(NULL, NULL, NULL);
|
||||
+ }
|
||||
+
|
||||
out = parse(command, ifd);
|
||||
if (!out) {
|
||||
return 0;
|
||||
|
|
|
@ -14,6 +14,8 @@ SRC_URI[sha256sum] = "8a0647c59ee0606f5da9205c5b3c5b000fea98fe39348f6bb2cba5fecf
|
|||
|
||||
CFLAGS += "-D'IFUPDOWN_VERSION="0.7"'"
|
||||
|
||||
PR = "r1"
|
||||
|
||||
do_configure() {
|
||||
chmod a+rx makecdep.sh makenwdep.sh
|
||||
}
|
||||
|
@ -24,6 +26,11 @@ do_install() {
|
|||
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifdown.${BPN}
|
||||
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifquery
|
||||
install -D -m 0755 settle-dad.sh ${D}/lib/ifupdown/settle-dad.sh
|
||||
if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -d ${D}${sysconfdir}/tmpfiles.d
|
||||
echo "d ${localstatedir}/run/network - - - -" \
|
||||
> ${D}${sysconfdir}/tmpfiles.d/02-ifupdown.conf
|
||||
fi
|
||||
}
|
||||
|
||||
inherit update-alternatives
|
||||
|
|
Loading…
Reference in New Issue