1 /* $NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $ */
6 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed for the FreeBSD project
19 * 4. Neither the name of the author nor the names of any co-contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY ANDREW GORDON AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #include <sys/cdefs.h>
39 __RCSID("$NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $");
43 * main() function for NFS lock daemon. Most of the code in this
44 * file was generated by running rpcgen /usr/include/rpcsvc/nlm_prot.x.
46 * The actual program logic is in the file lock_proc.c
49 #include <sys/param.h>
50 #include <sys/linker.h>
51 #include <sys/module.h>
52 #include <sys/socket.h>
55 #include <netinet/in.h>
56 #include <arpa/inet.h>
67 #include <netconfig.h>
71 #include <rpc/rpc_com.h>
72 #include <rpcsvc/sm_inter.h>
75 #include <rpcsvc/nlm_prot.h>
77 #define GETPORT_MAXTRY 20 /* Max tries to get a port # */
79 int debug_level = 0; /* 0 = no debugging syslog() calls */
85 int kernel_lockd_client;
88 char **hosts, *svcport_str = NULL;
89 static int mallocd_svcport = 0;
91 static int sock_fdcnt;
92 static int sock_fdpos;
95 char **addrs; /* actually (netid, uaddr) pairs */
96 int naddrs; /* count of how many (netid, uaddr) pairs */
97 char localhost[] = "localhost";
99 static int create_service(struct netconfig *nconf);
100 static void complete_service(struct netconfig *nconf, char *port_str);
101 static void clearout_service(void);
102 void lookup_addresses(struct netconfig *nconf);
104 void nlm_prog_0(struct svc_req *, SVCXPRT *);
105 void nlm_prog_1(struct svc_req *, SVCXPRT *);
106 void nlm_prog_3(struct svc_req *, SVCXPRT *);
107 void nlm_prog_4(struct svc_req *, SVCXPRT *);
108 void out_of_mem(void);
111 void sigalarm_handler(void);
114 * XXX move to some header file.
116 #define _PATH_RPCLOCKDSOCK "/var/run/rpclockd.sock"
119 main(int argc, char **argv)
123 char *endptr, **hosts_bak;
124 struct sigaction sigalarm;
125 int grace_period = 30;
126 struct netconfig *nconf;
128 int maxrec = RPC_MAXDATASIZE;
129 in_port_t svcport = 0;
130 int attempt_cnt, port_len, port_pos, ret;
133 while ((ch = getopt(argc, argv, "d:g:h:p:")) != (-1)) {
136 debug_level = atoi(optarg);
143 grace_period = atoi(optarg);
152 hosts_bak = realloc(hosts, nhosts * sizeof(char *));
153 if (hosts_bak == NULL) {
155 for (i = 0; i < nhosts; i++)
162 hosts[nhosts - 1] = strdup(optarg);
163 if (hosts[nhosts - 1] == NULL) {
164 for (i = 0; i < (nhosts - 1); i++)
172 svcport = (in_port_t)strtoul(optarg, &endptr, 10);
173 if (endptr == NULL || *endptr != '\0' ||
174 svcport == 0 || svcport >= IPPORT_MAX)
176 svcport_str = strdup(optarg);
184 if (geteuid()) { /* This command allowed only to root */
185 fprintf(stderr, "Sorry. You are not superuser\n");
189 kernel_lockd = FALSE;
190 kernel_lockd_client = FALSE;
191 if (modfind("nfslockd") < 0) {
192 if (kldload("nfslockd") < 0) {
193 fprintf(stderr, "Can't find or load kernel support for rpc.lockd - using non-kernel implementation\n");
201 if (getosreldate() >= 800040)
202 kernel_lockd_client = TRUE;
205 (void)rpcb_unset(NLM_PROG, NLM_SM, NULL);
206 (void)rpcb_unset(NLM_PROG, NLM_VERS, NULL);
207 (void)rpcb_unset(NLM_PROG, NLM_VERSX, NULL);
208 (void)rpcb_unset(NLM_PROG, NLM_VERS4, NULL);
211 * Check if IPv6 support is present.
213 s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
219 rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
222 * If no hosts were specified, add a wildcard entry to bind to
223 * INADDR_ANY. Otherwise make sure 127.0.0.1 and ::1 are added to the
227 hosts = malloc(sizeof(char**));
236 hosts_bak = realloc(hosts, (nhosts + 2) *
238 if (hosts_bak == NULL) {
239 for (i = 0; i < nhosts; i++)
247 hosts[nhosts - 2] = "::1";
249 hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *));
250 if (hosts_bak == NULL) {
251 for (i = 0; i < nhosts; i++)
261 hosts[nhosts - 1] = "127.0.0.1";
265 if (!kernel_lockd_client) {
267 * For the case where we have a kernel lockd but it
268 * doesn't provide client locking, we run a cut-down
269 * RPC service on a local-domain socket. The kernel's
270 * RPC server will pass what it can't handle (mainly
271 * client replies) down to us.
273 struct sockaddr_un sun;
277 memset(&sun, 0, sizeof sun);
278 sun.sun_family = AF_LOCAL;
279 unlink(_PATH_RPCLOCKDSOCK);
280 strcpy(sun.sun_path, _PATH_RPCLOCKDSOCK);
281 sun.sun_len = SUN_LEN(&sun);
282 fd = socket(AF_LOCAL, SOCK_STREAM, 0);
284 err(1, "Can't create local lockd socket");
286 oldmask = umask(S_IXUSR|S_IRWXG|S_IRWXO);
287 if (bind(fd, (struct sockaddr *) &sun, sun.sun_len) < 0) {
288 err(1, "Can't bind local lockd socket");
291 if (listen(fd, SOMAXCONN) < 0) {
292 err(1, "Can't listen on local lockd socket");
294 xprt = svc_vc_create(fd, RPC_MAXDATASIZE, RPC_MAXDATASIZE);
296 err(1, "Can't create transport for local lockd socket");
298 if (!svc_reg(xprt, NLM_PROG, NLM_VERS4, nlm_prog_4, NULL)) {
299 err(1, "Can't register service for local lockd socket");
304 * We need to look up the addresses so that we can
305 * hand uaddrs (ascii encoded address+port strings) to
308 nc_handle = setnetconfig();
309 while ((nconf = getnetconfig(nc_handle))) {
310 /* We want to listen only on udp6, tcp6, udp, tcp transports */
311 if (nconf->nc_flag & NC_VISIBLE) {
312 /* Skip if there's no IPv6 support */
313 if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
316 lookup_addresses(nconf);
320 endnetconfig(nc_handle);
327 nc_handle = setnetconfig();
328 while ((nconf = getnetconfig(nc_handle))) {
329 /* We want to listen only on udp6, tcp6, udp, tcp transports */
330 if (nconf->nc_flag & NC_VISIBLE) {
331 /* Skip if there's no IPv6 support */
332 if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
335 ret = create_service(nconf);
337 /* Ignore this call */
341 * Failed to bind port, so close
342 * off all sockets created and
343 * try again if the port# was
344 * dynamically assigned via
348 if (mallocd_svcport != 0 &&
357 "bindresvport_sa: %m");
362 * Start over at the first
368 nc_handle = setnetconfig();
370 } else if (mallocd_svcport != 0 &&
371 attempt_cnt == GETPORT_MAXTRY) {
373 * For the last attempt, allow
374 * different port #s for each
375 * nconf by saving the
376 * svcport_str and setting it
379 port_list = realloc(port_list,
382 if (port_list == NULL)
384 port_list[port_len++] =
394 * Successfully bound the ports, so call complete_service() to
395 * do the rest of the setup on the service(s).
399 nc_handle = setnetconfig();
400 while ((nconf = getnetconfig(nc_handle))) {
401 /* We want to listen only on udp6, tcp6, udp, tcp transports */
402 if (nconf->nc_flag & NC_VISIBLE) {
403 /* Skip if there's no IPv6 support */
404 if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
406 } else if (port_list != NULL) {
407 if (port_pos >= port_len) {
412 complete_service(nconf,
413 port_list[port_pos++]);
415 complete_service(nconf, svcport_str);
418 endnetconfig(nc_handle);
420 if (port_list != NULL) {
421 for (port_pos = 0; port_pos < port_len; port_pos++)
422 free(port_list[port_pos]);
428 * Note that it is NOT sensible to run this program from inetd - the
429 * protocol assumes that it will run immediately at boot time.
431 if (daemon(0, debug_level > 0)) {
432 err(1, "cannot fork");
436 openlog("rpc.lockd", 0, LOG_DAEMON);
438 syslog(LOG_INFO, "Starting, debug level %d", debug_level);
440 syslog(LOG_INFO, "Starting");
442 sigalarm.sa_handler = (sig_t) sigalarm_handler;
443 sigemptyset(&sigalarm.sa_mask);
444 sigalarm.sa_flags = SA_RESETHAND; /* should only happen once */
445 sigalarm.sa_flags |= SA_RESTART;
446 if (sigaction(SIGALRM, &sigalarm, NULL) != 0) {
447 syslog(LOG_WARNING, "sigaction(SIGALRM) failed: %s",
453 if (!kernel_lockd_client) {
455 client_pid = client_request();
458 * Create a child process to enter the kernel and then
459 * wait for RPCs on our local domain socket.
462 nlm_syscall(debug_level, grace_period,
468 * The kernel lockd implementation provides
469 * both client and server so we don't need to
472 nlm_syscall(debug_level, grace_period, naddrs, addrs);
480 client_pid = client_request();
482 svc_run(); /* Should never return */
488 * This routine creates and binds sockets on the appropriate
489 * addresses. It gets called one time for each transport.
490 * It returns 0 upon success, 1 for ingore the call and -1 to indicate
491 * bind failed with EADDRINUSE.
492 * Any file descriptors that have been created are stored in sock_fd and
493 * the total count of them is maintained in sock_fdcnt.
496 create_service(struct netconfig *nconf)
498 struct addrinfo hints, *res = NULL;
499 struct sockaddr_in *sin;
500 struct sockaddr_in6 *sin6;
501 struct __rpc_sockinfo si;
506 u_int32_t host_addr[4]; /* IPv4 or IPv6 */
509 if ((nconf->nc_semantics != NC_TPI_CLTS) &&
510 (nconf->nc_semantics != NC_TPI_COTS) &&
511 (nconf->nc_semantics != NC_TPI_COTS_ORD))
512 return (1); /* not my type */
515 * XXX - using RPC library internal functions.
517 if (!__rpc_nconf2sockinfo(nconf, &si)) {
518 syslog(LOG_ERR, "cannot get information for %s",
523 /* Get rpc.statd's address on this transport */
524 memset(&hints, 0, sizeof hints);
525 hints.ai_family = si.si_af;
526 hints.ai_socktype = si.si_socktype;
527 hints.ai_protocol = si.si_proto;
530 * Bind to specific IPs if asked to
533 while (nhostsbak > 0) {
535 sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int));
538 sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */
540 hints.ai_flags = AI_PASSIVE;
543 * XXX - using RPC library internal functions.
545 if ((fd = __rpc_nconf2fd(nconf)) < 0) {
546 syslog(LOG_ERR, "cannot create socket for %s",
551 switch (hints.ai_family) {
553 if (inet_pton(AF_INET, hosts[nhostsbak],
555 hints.ai_flags |= AI_NUMERICHOST;
558 * Skip if we have an AF_INET6 address.
560 if (inet_pton(AF_INET6, hosts[nhostsbak],
568 if (inet_pton(AF_INET6, hosts[nhostsbak],
570 hints.ai_flags |= AI_NUMERICHOST;
573 * Skip if we have an AF_INET address.
575 if (inet_pton(AF_INET, hosts[nhostsbak],
587 * If no hosts were specified, just bind to INADDR_ANY
589 if (strcmp("*", hosts[nhostsbak]) == 0) {
590 if (svcport_str == NULL) {
591 res = malloc(sizeof(struct addrinfo));
595 res->ai_flags = hints.ai_flags;
596 res->ai_family = hints.ai_family;
597 res->ai_protocol = hints.ai_protocol;
598 switch (res->ai_family) {
600 sin = malloc(sizeof(struct sockaddr_in));
603 sin->sin_family = AF_INET;
604 sin->sin_port = htons(0);
605 sin->sin_addr.s_addr = htonl(INADDR_ANY);
606 res->ai_addr = (struct sockaddr*) sin;
607 res->ai_addrlen = (socklen_t)
608 sizeof(struct sockaddr_in);
611 sin6 = malloc(sizeof(struct sockaddr_in6));
614 sin6->sin6_family = AF_INET6;
615 sin6->sin6_port = htons(0);
616 sin6->sin6_addr = in6addr_any;
617 res->ai_addr = (struct sockaddr*) sin6;
618 res->ai_addrlen = (socklen_t)
619 sizeof(struct sockaddr_in6);
628 if ((aicode = getaddrinfo(NULL, svcport_str,
629 &hints, &res)) != 0) {
631 "cannot get local address for %s: %s",
633 gai_strerror(aicode));
639 if ((aicode = getaddrinfo(hosts[nhostsbak], svcport_str,
640 &hints, &res)) != 0) {
642 "cannot get local address for %s: %s",
643 nconf->nc_netid, gai_strerror(aicode));
651 sock_fd[sock_fdcnt - 1] = fd;
653 /* Now, attempt the bind. */
654 r = bindresvport_sa(fd, res->ai_addr);
656 if (errno == EADDRINUSE && mallocd_svcport != 0) {
657 if (mallocd_res != 0) {
664 syslog(LOG_ERR, "bindresvport_sa: %m");
668 if (svcport_str == NULL) {
669 svcport_str = malloc(NI_MAXSERV * sizeof(char));
670 if (svcport_str == NULL)
674 if (getnameinfo(res->ai_addr,
675 res->ai_addr->sa_len, NULL, NI_MAXHOST,
676 svcport_str, NI_MAXSERV * sizeof(char),
677 NI_NUMERICHOST | NI_NUMERICSERV))
678 errx(1, "Cannot get port number");
680 if (mallocd_res != 0) {
691 * Called after all the create_service() calls have succeeded, to complete
692 * the setup and registration.
695 complete_service(struct netconfig *nconf, char *port_str)
697 struct addrinfo hints, *res = NULL;
698 struct __rpc_sockinfo si;
699 struct netbuf servaddr;
700 SVCXPRT *transp = NULL;
701 int aicode, fd, nhostsbak;
704 if ((nconf->nc_semantics != NC_TPI_CLTS) &&
705 (nconf->nc_semantics != NC_TPI_COTS) &&
706 (nconf->nc_semantics != NC_TPI_COTS_ORD))
707 return; /* not my type */
710 * XXX - using RPC library internal functions.
712 if (!__rpc_nconf2sockinfo(nconf, &si)) {
713 syslog(LOG_ERR, "cannot get information for %s",
719 while (nhostsbak > 0) {
721 if (sock_fdpos >= sock_fdcnt) {
722 /* Should never happen. */
723 syslog(LOG_ERR, "Ran out of socket fd's");
726 fd = sock_fd[sock_fdpos++];
730 if (nconf->nc_semantics != NC_TPI_CLTS)
731 listen(fd, SOMAXCONN);
733 transp = svc_tli_create(fd, nconf, NULL,
734 RPC_MAXDATASIZE, RPC_MAXDATASIZE);
736 if (transp != (SVCXPRT *) NULL) {
737 if (!svc_reg(transp, NLM_PROG, NLM_SM, nlm_prog_0,
740 "can't register %s NLM_PROG, NLM_SM service",
743 if (!svc_reg(transp, NLM_PROG, NLM_VERS, nlm_prog_1,
746 "can't register %s NLM_PROG, NLM_VERS service",
749 if (!svc_reg(transp, NLM_PROG, NLM_VERSX, nlm_prog_3,
752 "can't register %s NLM_PROG, NLM_VERSX service",
755 if (!svc_reg(transp, NLM_PROG, NLM_VERS4, nlm_prog_4,
758 "can't register %s NLM_PROG, NLM_VERS4 service",
762 syslog(LOG_WARNING, "can't create %s services",
765 if (registered == 0) {
767 memset(&hints, 0, sizeof hints);
768 hints.ai_flags = AI_PASSIVE;
769 hints.ai_family = si.si_af;
770 hints.ai_socktype = si.si_socktype;
771 hints.ai_protocol = si.si_proto;
773 if ((aicode = getaddrinfo(NULL, port_str, &hints,
775 syslog(LOG_ERR, "cannot get local address: %s",
776 gai_strerror(aicode));
780 servaddr.buf = malloc(res->ai_addrlen);
781 memcpy(servaddr.buf, res->ai_addr, res->ai_addrlen);
782 servaddr.len = res->ai_addrlen;
784 rpcb_set(NLM_PROG, NLM_SM, nconf, &servaddr);
785 rpcb_set(NLM_PROG, NLM_VERS, nconf, &servaddr);
786 rpcb_set(NLM_PROG, NLM_VERSX, nconf, &servaddr);
787 rpcb_set(NLM_PROG, NLM_VERS4, nconf, &servaddr);
796 * Clear out sockets after a failure to bind one of them, so that the
797 * cycle of socket creation/binding can start anew.
800 clearout_service(void)
804 for (i = 0; i < sock_fdcnt; i++) {
805 if (sock_fd[i] >= 0) {
806 shutdown(sock_fd[i], SHUT_RDWR);
813 * Look up addresses for the kernel to create transports for.
816 lookup_addresses(struct netconfig *nconf)
818 struct addrinfo hints, *res = NULL;
819 struct sockaddr_in *sin;
820 struct sockaddr_in6 *sin6;
821 struct __rpc_sockinfo si;
822 struct netbuf servaddr;
825 u_int32_t host_addr[4]; /* IPv4 or IPv6 */
828 if ((nconf->nc_semantics != NC_TPI_CLTS) &&
829 (nconf->nc_semantics != NC_TPI_COTS) &&
830 (nconf->nc_semantics != NC_TPI_COTS_ORD))
831 return; /* not my type */
834 * XXX - using RPC library internal functions.
836 if (!__rpc_nconf2sockinfo(nconf, &si)) {
837 syslog(LOG_ERR, "cannot get information for %s",
842 /* Get rpc.statd's address on this transport */
843 memset(&hints, 0, sizeof hints);
844 hints.ai_flags = AI_PASSIVE;
845 hints.ai_family = si.si_af;
846 hints.ai_socktype = si.si_socktype;
847 hints.ai_protocol = si.si_proto;
850 * Bind to specific IPs if asked to
853 while (nhostsbak > 0) {
856 switch (hints.ai_family) {
858 if (inet_pton(AF_INET, hosts[nhostsbak],
860 hints.ai_flags &= AI_NUMERICHOST;
863 * Skip if we have an AF_INET6 address.
865 if (inet_pton(AF_INET6, hosts[nhostsbak],
872 if (inet_pton(AF_INET6, hosts[nhostsbak],
874 hints.ai_flags &= AI_NUMERICHOST;
877 * Skip if we have an AF_INET address.
879 if (inet_pton(AF_INET, hosts[nhostsbak],
890 * If no hosts were specified, just bind to INADDR_ANY
892 if (strcmp("*", hosts[nhostsbak]) == 0) {
893 if (svcport_str == NULL) {
894 res = malloc(sizeof(struct addrinfo));
897 res->ai_flags = hints.ai_flags;
898 res->ai_family = hints.ai_family;
899 res->ai_protocol = hints.ai_protocol;
900 switch (res->ai_family) {
902 sin = malloc(sizeof(struct sockaddr_in));
905 sin->sin_family = AF_INET;
906 sin->sin_port = htons(0);
907 sin->sin_addr.s_addr = htonl(INADDR_ANY);
908 res->ai_addr = (struct sockaddr*) sin;
909 res->ai_addrlen = (socklen_t)
910 sizeof(res->ai_addr);
913 sin6 = malloc(sizeof(struct sockaddr_in6));
916 sin6->sin6_family = AF_INET6;
917 sin6->sin6_port = htons(0);
918 sin6->sin6_addr = in6addr_any;
919 res->ai_addr = (struct sockaddr*) sin6;
920 res->ai_addrlen = (socklen_t) sizeof(res->ai_addr);
926 if ((aicode = getaddrinfo(NULL, svcport_str,
927 &hints, &res)) != 0) {
929 "cannot get local address for %s: %s",
931 gai_strerror(aicode));
936 if ((aicode = getaddrinfo(hosts[nhostsbak], svcport_str,
937 &hints, &res)) != 0) {
939 "cannot get local address for %s: %s",
940 nconf->nc_netid, gai_strerror(aicode));
945 servaddr.len = servaddr.maxlen = res->ai_addr->sa_len;
946 servaddr.buf = res->ai_addr;
947 uaddr = taddr2uaddr(nconf, &servaddr);
949 addrs = realloc(addrs, 2 * (naddrs + 1) * sizeof(char *));
952 addrs[2 * naddrs] = strdup(nconf->nc_netid);
953 addrs[2 * naddrs + 1] = uaddr;
959 sigalarm_handler(void)
968 errx(1, "usage: rpc.lockd [-d <debuglevel>]"
969 " [-g <grace period>] [-h <bindip>] [-p <port>]");
974 * Reset the NSM state-of-the-world and acquire its state.
982 char name[] = "NFS NLM";
986 * The my_id structure isn't used by the SM_UNMON_ALL call, as far
987 * as I know. Leave it empty for now.
989 memset(&id, 0, sizeof(id));
994 * The statd program must already be registered when lockd runs.
997 ret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON_ALL,
998 (xdrproc_t)xdr_my_id, &id, (xdrproc_t)xdr_sm_stat, &stat);
999 if (ret == RPC_PROGUNAVAIL) {
1000 syslog(LOG_WARNING, "%lu %s", SM_PROG,
1009 syslog(LOG_ERR, "%lu %s", SM_PROG, clnt_sperrno(ret));
1013 nsm_state = stat.state;
1015 /* setup constant data for SM_MON calls */
1016 mon_host.mon_id.my_id.my_name = localhost;
1017 mon_host.mon_id.my_id.my_prog = NLM_PROG;
1018 mon_host.mon_id.my_id.my_vers = NLM_SM;
1019 mon_host.mon_id.my_id.my_proc = NLM_SM_NOTIFY; /* bsdi addition */
1023 * Out of memory, fatal
1027 syslog(LOG_ERR, "out of memory");