/* Returns zero on success; a negative errno value is returned if any error occurs.  */
static int __svc_rpcb_register4(const u32 program, const u32 version, const unsigned short protocol, const unsigned short port)
/* Returns zero on success; a negative errno value is returned if any error occurs.  */
static int __svc_rpcb_register4(const u32 program, const u32 version, const unsigned short protocol, const unsigned short port)
{
	const struct sockaddr_in sin = {
		.sin_family		= AF_INET,
		.sin_addr.s_addr	= htonl(INADDR_ANY),
		.sin_port		= htons(port),
	};
	const char *netid;
	int error;
	switch (protocol) {
	case IPPROTO_UDP:
		netid = RPCBIND_NETID_UDP;
		break;
	case IPPROTO_TCP:
		netid = RPCBIND_NETID_TCP;
		break;
	default:
		return -ENOPROTOOPT;
	}
	error = rpcb_v4_register(program, version,
					(const struct sockaddr *)&sin, netid);
	if (error == -EPROTONOSUPPORT)
		error = rpcb_register(program, version, protocol, port);
	return error;
}