This hook makes it possible to do some helper work in hotplug scripts
when a connection is not established successfully.
example: try several username/passwords from a pool to establish a
pppoe or wwan connection by replacing the configured values of the
connection in a hotplug script.
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
static const char * const eventnames[] = {
[IFEV_DOWN] = "ifdown",
[IFEV_UP] = "ifup",
static const char * const eventnames[] = {
[IFEV_DOWN] = "ifdown",
[IFEV_UP] = "ifup",
+ [IFEV_UP_FAILED] = "ifup-failed",
[IFEV_UPDATE] = "ifupdate",
[IFEV_FREE] = "free",
[IFEV_RELOAD] = "reload",
[IFEV_UPDATE] = "ifupdate",
[IFEV_FREE] = "free",
[IFEV_RELOAD] = "reload",
switch (ev) {
case IFEV_LINK_UP:
case IFEV_UP:
switch (ev) {
case IFEV_LINK_UP:
case IFEV_UP:
case IFEV_UPDATE:
case IFEV_DOWN:
interface_queue_event(iface, ev);
case IFEV_UPDATE:
case IFEV_DOWN:
interface_queue_event(iface, ev);
adev = iface->l3_dev.dev;
/* fall through */
case IFEV_DOWN:
adev = iface->l3_dev.dev;
/* fall through */
case IFEV_DOWN:
alias_notify_device(iface->name, adev);
break;
default:
alias_notify_device(iface->name, adev);
break;
default:
iface->state = IFS_DOWN;
if (state == IFS_UP)
interface_event(iface, IFEV_DOWN);
iface->state = IFS_DOWN;
if (state == IFS_UP)
interface_event(iface, IFEV_DOWN);
+ else
+ interface_event(iface, IFEV_UP_FAILED);
interface_ip_set_enabled(&iface->config_ip, false);
interface_ip_set_enabled(&iface->proto_ip, false);
interface_ip_flush(&iface->proto_ip);
interface_ip_set_enabled(&iface->config_ip, false);
interface_ip_set_enabled(&iface->proto_ip, false);
interface_ip_flush(&iface->proto_ip);
interface_set_available(alias, true);
break;
case IFEV_DOWN:
interface_set_available(alias, true);
break;
case IFEV_DOWN:
interface_set_available(alias, false);
interface_set_main_dev(alias, NULL);
break;
interface_set_available(alias, false);
interface_set_main_dev(alias, NULL);
break;
enum interface_event {
IFEV_DOWN,
IFEV_UP,
enum interface_event {
IFEV_DOWN,
IFEV_UP,
IFEV_UPDATE,
IFEV_FREE,
IFEV_RELOAD,
IFEV_UPDATE,
IFEV_FREE,
IFEV_RELOAD,