changeset 10690:c9e94c239e8c

PSARC 2009/477 Addition of NE_IFINDEX_CHANGE to <sys/neti.h> 6876435 NE_IFINDEX_CHANGE event must be emitted, when physical interface index changes.
author Alexandr Nedvedicky <Alexandr.Nedvedicky@Sun.COM>
date Wed, 30 Sep 2009 13:07:19 +0200
parents a067a728d369
children 36de6b202f7e
files usr/src/uts/common/inet/ip/ip_if.c usr/src/uts/common/sys/hook_event.h
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/inet/ip/ip_if.c	Tue Sep 29 20:41:29 2009 -0700
+++ b/usr/src/uts/common/inet/ip/ip_if.c	Wed Sep 30 13:07:19 2009 +0200
@@ -17637,7 +17637,14 @@
 		return (EEXIST);
 	}
 
-	/* The new index is unused. Set it in the phyint. */
+	/*
+	 * The new index is unused. Set it in the phyint. However we must not
+	 * forget to trigger NE_IFINDEX_CHANGE event before the ifindex
+	 * changes. The event must be bound to old ifindex value.
+	 */
+	ill_nic_event_dispatch(ill, 0, NE_IFINDEX_CHANGE,
+	    &index, sizeof (index));
+
 	old_index = phyi->phyint_ifindex;
 	phyi->phyint_ifindex = index;
 
@@ -20265,6 +20272,8 @@
 		return ("LIF_UP");
 	case NE_LIF_DOWN:
 		return ("LIF_DOWN");
+	case NE_IFINDEX_CHANGE:
+		return ("IFINDEX_CHANGE");
 	default:
 		return ("UNKNOWN");
 	}
--- a/usr/src/uts/common/sys/hook_event.h	Tue Sep 29 20:41:29 2009 -0700
+++ b/usr/src/uts/common/sys/hook_event.h	Wed Sep 30 13:07:19 2009 +0200
@@ -76,7 +76,8 @@
 	NE_DOWN,
 	NE_ADDRESS_CHANGE,
 	NE_LIF_UP,
-	NE_LIF_DOWN
+	NE_LIF_DOWN,
+	NE_IFINDEX_CHANGE
 } nic_event_t;
 
 typedef void *nic_event_data_t;