changeset 4293:3c6c7c2c4d21

6556695 ipmp_hook_emulation forgets to drop ill_lock in some cases; networking wedges 6556698 ipmp_hook_emulation logic incorrectly checks PHYI_STANDBY
author yx160601
date Tue, 22 May 2007 11:28:03 -0700
parents d7beef35913b
children c6dec793768d
files usr/src/uts/common/inet/ip/ip_if.c usr/src/uts/common/inet/ip/ip_netinfo.c
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/inet/ip/ip_if.c	Tue May 22 11:10:09 2007 -0700
+++ b/usr/src/uts/common/inet/ip/ip_if.c	Tue May 22 11:28:03 2007 -0700
@@ -16419,7 +16419,7 @@
  * be more than one when there are ill groups.
  *
  * If 'usable' is set, then we exclude ones that are marked with any of
- * (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE).
+ * (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE).
  * Needs work: called only from ip_sioctl_groupname and from the ipmp/netinfo
  * emulation of ipmp.
  */
@@ -16444,7 +16444,7 @@
 		 * sometime use this for sending packets.
 		 */
 		if (usable && (phyi->phyint_flags &
-		    (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE)))
+		    (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE)))
 			continue;
 
 		ASSERT(phyi->phyint_groupname != NULL);
@@ -16458,7 +16458,7 @@
 /*
  * Return the first usable phyint matching the group index. By 'usable'
  * we exclude ones that are marked ununsable with any of
- * (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE).
+ * (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE).
  *
  * Used only for the ipmp/netinfo emulation of ipmp.
  */
@@ -16490,7 +16490,7 @@
 		 * sometime use this for sending packets.
 		 */
 		if (phyi->phyint_flags &
-		    (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE))
+		    (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE))
 			continue;
 		if (phyi->phyint_group_ifindex == group_ifindex)
 			return (phyi);
--- a/usr/src/uts/common/inet/ip/ip_netinfo.c	Tue May 22 11:10:09 2007 -0700
+++ b/usr/src/uts/common/inet/ip/ip_netinfo.c	Tue May 22 11:28:03 2007 -0700
@@ -1351,7 +1351,7 @@
  * Temporary function to support IPMP emulation for IP Filter.
  * Lookup an ill based on the ifindex assigned to the group.
  * Skips unusable ones i.e. where any of these flags are set:
- * (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE)
+ * (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE)
  */
 ill_t *
 ill_group_lookup_on_ifindex(uint_t index, boolean_t isv6, ip_stack_t *ipst)
@@ -1371,6 +1371,7 @@
 				rw_exit(&ipst->ips_ill_g_lock);
 				return (ill);
 			}
+			mutex_exit(&ill->ill_lock);
 		}
 	}
 	rw_exit(&ipst->ips_ill_g_lock);
@@ -1381,7 +1382,7 @@
  * Temporary function to support IPMP emulation for IP Filter.
  * Lookup an ill based on the group name.
  * Skips unusable ones i.e. where any of these flags are set:
- * (PHYI_FAILED|PHYI_STANDBY|PHYI_OFFLINE|PHYI_INACTIVE)
+ * (PHYI_FAILED|PHYI_OFFLINE|PHYI_INACTIVE)
  */
 ill_t *
 ill_group_lookup_on_name(char *name, boolean_t isv6, ip_stack_t *ipst)
@@ -1401,6 +1402,7 @@
 				rw_exit(&ipst->ips_ill_g_lock);
 				return (ill);
 			}
+			mutex_exit(&ill->ill_lock);
 		}
 	}
 	rw_exit(&ipst->ips_ill_g_lock);