summaryrefslogtreecommitdiff
path: root/usr/src/lib/libuuid/common/etheraddr.c
diff options
context:
space:
mode:
authoryz147064 <none@none>2008-01-23 18:09:15 -0800
committeryz147064 <none@none>2008-01-23 18:09:15 -0800
commitd62bc4badc1c1f1549c961cfb8b420e650e1272b (patch)
tree9f466859e9cfb73da13b64261432aba4683f19ad /usr/src/lib/libuuid/common/etheraddr.c
parentd38257c4392a9dd690c2f7f2383236c1fc80e509 (diff)
downloadillumos-gate-d62bc4badc1c1f1549c961cfb8b420e650e1272b.tar.gz
PSARC/2006/499 Clearview Nemo unification and vanity naming
PSARC/2007/527 Addendum for Clearview Vanity Naming and Nemo Unification PSARC/2008/002 Clearview UV Updates 6310766 vlan statistics get reset at unplumb time 6320515 dladm commands with "-R" option should not take effect immediately 6433732 Simplify the GLDv3 control path by making its processing asynchronous 6445912 dladm show-link fails to show a specific link in the debug version 6452413 dladm show-link doesn't show VLAN links for GLDv2 drivers 6504433 libwladm's use of wladm_wlresult2status() needs an overhaul 6504507 dladm set-linkprop failure message is unclear 6534289 DR should work with aggregations 6535719 dladm_aggr_port_attr_db_t`lp_devname should be MAXNAMELEN, not MAXNAMELEN + 1 6539634 GLDv3 should DL_ERROR_ACK a DL_UDQOS_REQ with DL_OUTSTATE when the stream is DL_UNATTACHED 6540246 libdladm should not guess zoneid from DLDIOCZIDGET ioctl errno 6544195 dladm show-dev assumes GLDv3 stats.. incompatible with GLDv2 6563295 dladm show-linkprop -P does not work properly for unavailable links 6577618 integrate network vanity naming and nemo unification 6600446 links assigned to a local zone are still aggregatable by global zone 6607572 "boot net - install" can trigger assertion failure in dld_str_attach() 6613956 "svccfg import -" does not work as bfu expects 6637596 invalid assertion in ip_soft_ring_assignment() 6642350 kernel DLPI processing routines are long overdue 6643338 GLDv3 PPA hack VLAN ID checks don't always work 6647203 bfu: smf_delete_manifest() does not work for non-global zones 6649885 DL_IB GLDv3 mactype plugin must fill in its mtr_nativetype 6650395 libuuid should be lint-clean and linted nightly --HG-- rename : usr/src/cmd/dladm/aggregation.conf => deleted_files/usr/src/cmd/dladm/aggregation.conf rename : usr/src/cmd/dladm/linkprop.conf => deleted_files/usr/src/cmd/dladm/linkprop.conf rename : usr/src/lib/libinetcfg/common/inetcfg_nic.c => deleted_files/usr/src/lib/libinetcfg/common/inetcfg_nic.c rename : usr/src/lib/libinetcfg/common/inetcfg_nic.h => deleted_files/usr/src/lib/libinetcfg/common/inetcfg_nic.h
Diffstat (limited to 'usr/src/lib/libuuid/common/etheraddr.c')
-rw-r--r--usr/src/lib/libuuid/common/etheraddr.c55
1 files changed, 17 insertions, 38 deletions
diff --git a/usr/src/lib/libuuid/common/etheraddr.c b/usr/src/lib/libuuid/common/etheraddr.c
index 6b2011150e..08030e79cf 100644
--- a/usr/src/lib/libuuid/common/etheraddr.c
+++ b/usr/src/lib/libuuid/common/etheraddr.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -33,7 +33,6 @@
#include <uuid/uuid.h>
#include <sys/sockio.h>
#include <libdlpi.h>
-#include <libdllink.h>
#include <sys/utsname.h>
#include <netdb.h>
@@ -42,12 +41,7 @@
#include "etheraddr.h"
-/*
- * debugging flag
- */
-static int debug = 0;
-
-static void get_etheraddr(void *arg, const char *linkname);
+static boolean_t get_etheraddr(const char *linkname, void *arg);
/*
* get an individual arp entry
@@ -114,50 +108,35 @@ get_ethernet_address(uuid_node_t *node)
* Try to get physical (ethernet) address from network interfaces.
*/
state.wa_addrvalid = B_FALSE;
- if (dladm_walk(get_etheraddr, &state) == 0 && state.wa_addrvalid) {
+ dlpi_walk(get_etheraddr, &state, 0);
+ if (state.wa_addrvalid)
bcopy(state.wa_etheraddr, node, state.wa_etheraddrlen);
- }
return (state.wa_addrvalid ? 0 : -1);
}
/*
- * Get the physical address via dlpi and update the flag to true upon success.
+ * Get the physical address via DLPI and update the flag to true upon success.
*/
-static void
-get_etheraddr(void *arg, const char *linkname)
+static boolean_t
+get_etheraddr(const char *linkname, void *arg)
{
int retval;
dlpi_handle_t dh;
walker_arg_t *statep = arg;
- if (!(statep->wa_addrvalid)) {
- if (debug)
- (void) printf("get_etheraddr: opening %s\n", linkname);
- if ((retval = dlpi_open(linkname, &dh, 0)) != DLPI_SUCCESS) {
- if (debug) {
- (void) fprintf(stderr, "get_etheraddr: "
- "cannot open link: \"%s\" %s\n",
- linkname, retval);
- }
- return;
- }
+ if (dlpi_open(linkname, &dh, 0) != DLPI_SUCCESS)
+ return (B_FALSE);
- if (debug) {
- (void) printf("get_etheraddr: getting ethernet address"
- " from link: %s\n", linkname);
- }
- statep->wa_etheraddrlen = DLPI_PHYSADDR_MAX;
- retval = dlpi_get_physaddr(dh, DL_CURR_PHYS_ADDR,
- statep->wa_etheraddr, &(statep->wa_etheraddrlen));
- if (debug) {
- (void) fprintf(stderr, "get_etheraddr: "
- "dlpi_get_physaddr: \"%s\" %s\n", linkname, retval);
- }
+ statep->wa_etheraddrlen = DLPI_PHYSADDR_MAX;
+ retval = dlpi_get_physaddr(dh, DL_CURR_PHYS_ADDR,
+ statep->wa_etheraddr, &(statep->wa_etheraddrlen));
- if (retval == DLPI_SUCCESS)
- statep->wa_addrvalid = B_TRUE;
+ dlpi_close(dh);
- dlpi_close(dh);
+ if (retval == DLPI_SUCCESS) {
+ statep->wa_addrvalid = B_TRUE;
+ return (B_TRUE);
}
+ return (B_FALSE);
}