aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index b252401c8601..550441d13a08 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -644,23 +644,32 @@ svc_register(struct svc_serv *serv, int proto, unsigned short port)
644 unsigned long flags; 644 unsigned long flags;
645 int i, error = 0, dummy; 645 int i, error = 0, dummy;
646 646
647 progp = serv->sv_program;
648
649 dprintk("RPC: svc_register(%s, %s, %d)\n",
650 progp->pg_name, proto == IPPROTO_UDP? "udp" : "tcp", port);
651
652 if (!port) 647 if (!port)
653 clear_thread_flag(TIF_SIGPENDING); 648 clear_thread_flag(TIF_SIGPENDING);
654 649
655 for (i = 0; i < progp->pg_nvers; i++) { 650 for (progp = serv->sv_program; progp; progp = progp->pg_next) {
656 if (progp->pg_vers[i] == NULL) 651 for (i = 0; i < progp->pg_nvers; i++) {
657 continue; 652 if (progp->pg_vers[i] == NULL)
658 error = rpc_register(progp->pg_prog, i, proto, port, &dummy); 653 continue;
659 if (error < 0) 654
660 break; 655 dprintk("RPC: svc_register(%s, %s, %d, %d)%s\n",
661 if (port && !dummy) { 656 progp->pg_name,
662 error = -EACCES; 657 proto == IPPROTO_UDP? "udp" : "tcp",
663 break; 658 port,
659 i,
660 progp->pg_vers[i]->vs_hidden?
661 " (but not telling portmap)" : "");
662
663 if (progp->pg_vers[i]->vs_hidden)
664 continue;
665
666 error = rpc_register(progp->pg_prog, i, proto, port, &dummy);
667 if (error < 0)
668 break;
669 if (port && !dummy) {
670 error = -EACCES;
671 break;
672 }
664 } 673 }
665 } 674 }
666 675