X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;fp=proto.c;h=eaec91325653da91a74f9f589f52b1f50b443157;hp=0ba2fbe908486516c237e6999168938c1f1f7141;hb=92d2aea918f650f309f753349457028032d53280;hpb=3a0f953722698eab6f3f623a1d6ec5a1b7102b77 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