...
 
Commits (2)
No preview for this file type
......@@ -197,7 +197,8 @@ else
if [[ $( status shill | grep running ) ]] ; then
stop shill
fi
"${BASH_SOURCE%/*}"/shill_wrapper start shill BLACKLISTED_DEVICES="${blacklist_option}"
mount --bind "${BASH_SOURCE%/*}"/shill.sh /usr/share/cros/init/shill.sh
start shill BLACKLISTED_DEVICES="${blacklist_option}"
# wait a bit for the interfaces to be back
for i in {0..4} ; do
echo -n "." ; sleep 1
......
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
DAEMONBIN="shill"
ARGS="--log-level=${SHILL_LOG_LEVEL} --log-scopes=${SHILL_LOG_SCOPES}"
if [ -n "${SHILL_LOG_VMODULES}" ]; then
ARGS="${ARGS} --vmodule=${SHILL_LOG_VMODULES}"
fi
if [ -n "${BLACKLISTED_DEVICES}" ] && [ -n "${SHILL_TEST_DEVICES}" ]; then
ARGS="${ARGS} --device-black-list=${BLACKLISTED_DEVICES},${SHILL_TEST_DEVICES}"
elif [ -n "${BLACKLISTED_DEVICES}" ]; then
ARGS="${ARGS} --device-black-list=${BLACKLISTED_DEVICES}"
elif [ -n "${SHILL_TEST_DEVICES}" ]; then
ARGS="${ARGS} --device-black-list=${SHILL_TEST_DEVICES}"
fi
if [ -n "${SHILL_PASSIVE_MODE}" ]; then
ARGS="${ARGS} --passive-mode"
fi
if [ -n "${SHILL_PREPEND_DNS_SERVERS}" ]; then
ARGS="${ARGS} --prepend-dns-servers=${SHILL_PREPEND_DNS_SERVERS}"
fi
if [ -n "${SHILL_ACCEPT_HOSTNAME_FROM}" ]; then
ARGS="${ARGS} --accept-hostname-from=${SHILL_ACCEPT_HOSTNAME_FROM}"
fi
if [ -n "${SHILL_MINIMUM_MTU}" ]; then
ARGS="${ARGS} --minimum-mtu=${SHILL_MINIMUM_MTU}"
fi
if [ -n "${DHCPV6_ENABLED_DEVICES}" ]; then
ARGS="${ARGS} --dhcpv6-enabled-devices=${DHCPV6_ENABLED_DEVICES}"
fi
if [ -n "${ARC_DEVICE}" ]; then
ARGS="${ARGS} --arc-device=${ARC_DEVICE}"
fi
ARGS="${ARGS} ${SHILL_TEST_ARGS}"
# If OOBE has not completed (i.e. EULA not agreed to), do not run
# portal checks
if [ ! -f /home/chronos/.oobe_completed ]; then
ARGS="${ARGS} --portal-list="
fi
exec shill_wrapper ${DAEMONBIN} ${ARGS}
......@@ -26,10 +26,11 @@
#include <stdlib.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <unistd.h>
#include <sys/auxv.h>
#define ORIGINAL_CONF_PATH "/proc/sys/net/ipv6/conf/wlan0/accept_ra"
#define ORIGINAL_CONF_PATH "/proc/sys/net/ipv6/conf/*/accept_ra"
/* Standard O_TMPFILE includes O_DIRECTORY bit, but we do not want to call
* va_arg if O_DIRECTORY is set alone. Hence, define a "purer" O_TMPFILE. */
......@@ -64,7 +65,7 @@ static void init(void) {
int open(const char *__file, int __oflag, ...) {
if (!original_open)
init();
if (!strcmp(__file, ORIGINAL_CONF_PATH))
if (!fnmatch(ORIGINAL_CONF_PATH, __file, FNM_PATHNAME))
__file = "/dev/null";
if (__oflag & (O_CREAT | PURE_O_TMPFILE)) {
va_list ap;
......@@ -81,7 +82,7 @@ int open(const char *__file, int __oflag, ...) {
FILE *fopen(const char *path, const char *mode) {
if (!original_fopen)
init();
if (!strcmp(path, ORIGINAL_CONF_PATH))
if (!fnmatch(ORIGINAL_CONF_PATH, path, FNM_PATHNAME))
path = "/dev/null";
return (*original_fopen)(path, mode);
}
......