# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 23:15:28+01:00 kaber@coreworks.de # [PKT_SCHED]: cls_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/11 23:15:20+01:00 kaber@coreworks.de +14 -5 # [PKT_SCHED]: cls_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-11 23:17:58 +01:00 +++ b/net/sched/cls_api.c 2005-01-11 23:17:58 +01:00 @@ -219,20 +219,29 @@ err = -ENOBUFS; if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL) goto errout; + err = -EINVAL; tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND-1]); + if (tp_ops == NULL) { #ifdef CONFIG_KMOD - if (tp_ops==NULL && tca[TCA_KIND-1] != NULL) { struct rtattr *kind = tca[TCA_KIND-1]; char name[IFNAMSIZ]; - if (rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + if (kind != NULL && + rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + rtnl_unlock(); request_module("cls_%s", name); + rtnl_lock(); tp_ops = tcf_proto_lookup_ops(kind); + /* We dropped the RTNL semaphore in order to + * perform the module load. So, even if we + * succeeded in loading the module we have to + * replay the request. We indicate this using + * -EAGAIN. + */ + if (tp_ops != NULL) + err = -EAGAIN; } - } #endif - if (tp_ops == NULL) { - err = -EINVAL; kfree(tp); goto errout; }