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.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index c51fed4d1af1..41bc36ea2224 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -800,17 +800,17 @@ static int __svc_rpcb_register6(const u32 program, const u32 version,
800 * if any error occurs. 800 * if any error occurs.
801 */ 801 */
802static int __svc_register(const u32 program, const u32 version, 802static int __svc_register(const u32 program, const u32 version,
803 const sa_family_t family, 803 const int family,
804 const unsigned short protocol, 804 const unsigned short protocol,
805 const unsigned short port) 805 const unsigned short port)
806{ 806{
807 int error; 807 int error;
808 808
809 switch (family) { 809 switch (family) {
810 case AF_INET: 810 case PF_INET:
811 return __svc_rpcb_register4(program, version, 811 return __svc_rpcb_register4(program, version,
812 protocol, port); 812 protocol, port);
813 case AF_INET6: 813 case PF_INET6:
814 error = __svc_rpcb_register6(program, version, 814 error = __svc_rpcb_register6(program, version,
815 protocol, port); 815 protocol, port);
816 if (error < 0) 816 if (error < 0)
@@ -840,11 +840,11 @@ static int __svc_register(const u32 program, const u32 version,
840 * if any error occurs. 840 * if any error occurs.
841 */ 841 */
842static int __svc_register(const u32 program, const u32 version, 842static int __svc_register(const u32 program, const u32 version,
843 sa_family_t family, 843 const int family,
844 const unsigned short protocol, 844 const unsigned short protocol,
845 const unsigned short port) 845 const unsigned short port)
846{ 846{
847 if (family != AF_INET) 847 if (family != PF_INET)
848 return -EAFNOSUPPORT; 848 return -EAFNOSUPPORT;
849 849
850 return rpcb_register(program, version, protocol, port); 850 return rpcb_register(program, version, protocol, port);
@@ -855,13 +855,14 @@ static int __svc_register(const u32 program, const u32 version,
855/** 855/**
856 * svc_register - register an RPC service with the local portmapper 856 * svc_register - register an RPC service with the local portmapper
857 * @serv: svc_serv struct for the service to register 857 * @serv: svc_serv struct for the service to register
858 * @family: protocol family of service's listener socket
858 * @proto: transport protocol number to advertise 859 * @proto: transport protocol number to advertise
859 * @port: port to advertise 860 * @port: port to advertise
860 * 861 *
861 * Service is registered for any address in serv's address family 862 * Service is registered for any address in the passed-in protocol family
862 */ 863 */
863int svc_register(const struct svc_serv *serv, const unsigned short proto, 864int svc_register(const struct svc_serv *serv, const int family,
864 const unsigned short port) 865 const unsigned short proto, const unsigned short port)
865{ 866{
866 struct svc_program *progp; 867 struct svc_program *progp;
867 unsigned int i; 868 unsigned int i;
@@ -879,7 +880,7 @@ int svc_register(const struct svc_serv *serv, const unsigned short proto,
879 i, 880 i,
880 proto == IPPROTO_UDP? "udp" : "tcp", 881 proto == IPPROTO_UDP? "udp" : "tcp",
881 port, 882 port,
882 serv->sv_family, 883 family,
883 progp->pg_vers[i]->vs_hidden? 884 progp->pg_vers[i]->vs_hidden?
884 " (but not telling portmap)" : ""); 885 " (but not telling portmap)" : "");
885 886
@@ -887,7 +888,7 @@ int svc_register(const struct svc_serv *serv, const unsigned short proto,
887 continue; 888 continue;
888 889
889 error = __svc_register(progp->pg_prog, i, 890 error = __svc_register(progp->pg_prog, i,
890 serv->sv_family, proto, port); 891 family, proto, port);
891 if (error < 0) 892 if (error < 0)
892 break; 893 break;
893 } 894 }