aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/ematch.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-07-11 19:46:26 -0700
committerDavid S. Miller <davem@davemloft.net>2007-07-11 19:46:26 -0700
commitdb3d99c090e0cdb34b1274767e062bfddbb384bc (patch)
tree9130391307ac77b7f458db5d3994309df6c9877b /net/sched/ematch.c
parent[TCP]: tcp probe wraparound handling and other changes (diff)
downloadlinux-dev-db3d99c090e0cdb34b1274767e062bfddbb384bc.tar.xz
linux-dev-db3d99c090e0cdb34b1274767e062bfddbb384bc.zip
[NET_SCHED]: ematch: module autoloading
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/ematch.c')
-rw-r--r--net/sched/ematch.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 24837391640d..f3a104e323bd 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -222,6 +222,19 @@ static int tcf_em_validate(struct tcf_proto *tp,
if (em->ops == NULL) {
err = -ENOENT;
+#ifdef CONFIG_KMOD
+ __rtnl_unlock();
+ request_module("ematch-kind-%u", em_hdr->kind);
+ rtnl_lock();
+ em->ops = tcf_em_lookup(em_hdr->kind);
+ if (em->ops) {
+ /* We dropped the RTNL mutex in order to
+ * perform the module load. Tell the caller
+ * to replay the request. */
+ module_put(em->ops->owner);
+ err = -EAGAIN;
+ }
+#endif
goto errout;
}