X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=proto.c;h=eaec91325653da91a74f9f589f52b1f50b443157;hb=c68587663ef18fa87841be0a5281264361fab411;hp=0ba2fbe908486516c237e6999168938c1f1f7141;hpb=38c29e0bccabca0956498814729b2177b27e48a9;p=project%2Fnetifd.git diff --git a/proto.c b/proto.c index 0ba2fbe..eaec913 100644 --- a/proto.c +++ b/proto.c @@ -586,16 +586,20 @@ void proto_attach_interface(struct interface *iface, const char *proto_name) { const struct proto_handler *proto = &no_proto; + const char *error = NULL; if (proto_name) { proto = get_proto_handler(proto_name); if (!proto) { - interface_add_error(iface, "proto", "INVALID_PROTO", NULL, 0); + error = "INVALID_PROTO"; proto = &no_proto; } } iface->proto_handler = proto; + + if (error) + interface_add_error(iface, "proto", error, NULL, 0); } int