summaryrefslogtreecommitdiff
path: root/usr/src/lib/libipmp/common/ipmp_mpathd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libipmp/common/ipmp_mpathd.c')
-rw-r--r--usr/src/lib/libipmp/common/ipmp_mpathd.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/usr/src/lib/libipmp/common/ipmp_mpathd.c b/usr/src/lib/libipmp/common/ipmp_mpathd.c
index ee1d35de33..e24de71017 100644
--- a/usr/src/lib/libipmp/common/ipmp_mpathd.c
+++ b/usr/src/lib/libipmp/common/ipmp_mpathd.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -18,14 +17,11 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- */
-/*
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Low-level interfaces for communicating with in.mpathd(1M).
*
@@ -66,16 +62,16 @@ ipmp_connect(int *fdp)
return (IPMP_FAILURE);
/*
- * Enable TCP_ANONPRIVBIND so the kernel will choose our source port.
- * Since we're using loopback sockets, requiring use of privileged
- * source ports is sufficient for security.
+ * If we have sufficient privilege, enable TCP_ANONPRIVBIND so the
+ * kernel will choose a privileged source port (since in.mpathd only
+ * accepts requests on loopback, this is sufficient for security).
+ * If not, drive on since MI_QUERY and MI_PING commands are allowed
+ * from non-privileged ports.
*/
- if (setsockopt(fd, IPPROTO_TCP, TCP_ANONPRIVBIND, &on,
- sizeof (on)) == -1)
- goto fail;
+ (void) setsockopt(fd, IPPROTO_TCP, TCP_ANONPRIVBIND, &on, sizeof (on));
/*
- * Bind to a privileged port chosen by the kernel.
+ * Bind to a port chosen by the kernel.
*/
(void) memset(&sin, 0, sizeof (struct sockaddr_in));
sin.sin_port = htons(0);