X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=interface.c;h=522e7fe0c40c888351857e7e6874ea7f8f2d8739;hb=6228d0f21b2dcf20d7b2223c43f8b90b9b51bc4d;hp=a014111aaadb4478ae9e2cdd978d2bc21d767028;hpb=b8ef742bd04ebef324ae11aee56c6e1d2cb7e0ad;p=project%2Fnetifd.git diff --git a/interface.c b/interface.c index a014111..522e7fe 100644 --- a/interface.c +++ b/interface.c @@ -94,11 +94,11 @@ interface_error_flush(struct interface *iface) static void interface_clear_errors(struct interface *iface) { - /* don't flush the errors in case the configured protocol handler matches the + /* don't flush the errors in case the configured protocol handler matches the running protocol handler and is having the last error capability */ if (!(iface->proto && - (iface->proto->handler->flags & PROTO_FLAG_LASTERROR) && - (iface->proto->handler->name == iface->proto_handler->name))) + (iface->proto->handler->flags & PROTO_FLAG_LASTERROR) && + (iface->proto->handler->name == iface->proto_handler->name))) interface_error_flush(iface); } @@ -110,12 +110,12 @@ void interface_add_error(struct interface *iface, const char *subsystem, int *datalen = NULL; char *dest, *d_subsys, *d_code; - /* if the configured protocol handler has the last error support capability, + /* if the configured protocol handler has the last error support capability, errors should only be added if the running protocol handler matches the configured one */ if (iface->proto && - (iface->proto->handler->flags & PROTO_FLAG_LASTERROR) && - (iface->proto->handler->name != iface->proto_handler->name)) + (iface->proto->handler->flags & PROTO_FLAG_LASTERROR) && + (iface->proto->handler->name != iface->proto_handler->name)) return; if (n_data) {