Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
--- agent/mibgroup/ip-mib/data_access/ipaddress_common.c.orig	2011-09-28 06:53:47.000000000 +0200
+++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c	2012-02-18 21:20:51.943118452 +0100
@@ -452,6 +452,7 @@
 {
     const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
     const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
+    int   rc;
 
     netsnmp_assert(NULL != lhs);
     netsnmp_assert(NULL != rhs);
@@ -467,7 +468,19 @@
     /*
      * length equal, compare address
      */
-    return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+    rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+    if (rc)
+        return rc;
+
+    /*
+     * address same, compare ifIndex
+     */
+    if (lh->if_index < rh->if_index)
+        return -1;
+    else if (lh->if_index > rh->if_index)
+        return 1;
+
+    return 0;
 }
 
 #ifndef NETSNMP_FEATURE_REMOVE_IPADDRESS_COMMON_COPY_UTILITIES
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.orig	2011-09-28 06:53:47.000000000 +0200
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h	2012-02-18 21:20:51.939850024 +0100
@@ -106,7 +106,9 @@
      * simplistic map of address length to type
      */
 #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4  4
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5
 #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6  16
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17
 
 
 /*************************************************************
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.orig	2012-02-18 21:02:55.315118127 +0100
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c	2012-02-18 21:20:51.933373869 +0100
@@ -262,9 +262,10 @@
     if ((NULL != rowreq_ctx) &&
         (MFD_SUCCESS ==
          ipAddressTable_indexes_set(rowreq_ctx,
-                                    ipaddress_entry->ia_address_len,
+                                    ipaddress_entry->ia_address_len + 1,
                                     ipaddress_entry->ia_address,
-                                    ipaddress_entry->ia_address_len))) {
+                                    ipaddress_entry->ia_address_len,
+                                    ipaddress_entry->if_index))) {
         if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
             DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
             ipAddressTable_release_rowreq_ctx(rowreq_ctx);
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.orig	2011-09-28 06:53:47.000000000 +0200
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c	2012-02-18 21:24:03.877503380 +0100
@@ -355,10 +355,18 @@
         *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
         break;
 
+    case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z:
+        *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z;
+        break;
+
     case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
         *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
         break;
 
+    case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z:
+        *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z;
+        break;
+
     default:
         snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
                  raw_ipAddressAddrType_val);
@@ -389,8 +397,10 @@
 ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
                                    long ipAddressAddrType_val,
                                    u_char *ipAddressAddr_val_ptr,
-                                   size_t ipAddressAddr_val_ptr_len)
+                                   size_t ipAddressAddr_val_ptr_len,
+                                   long ipAddressAddr_ifIndex)
 {
+    uint32_t zone = htonl(ipAddressAddr_ifIndex);
     DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
 
     /*
@@ -416,6 +426,11 @@
     memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
            ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
 
+    /** zone */
+    tbl_idx->ipAddressAddr_len += sizeof(zone);
+    memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len *
+                                   sizeof(ipAddressAddr_val_ptr[0])],
+           &zone, sizeof(zone));
 
     return MFD_SUCCESS;
 }                               /* ipAddressTable_indexes_set_tbl_idx */
@@ -437,7 +452,8 @@
 ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
                            u_long ipAddressAddrType_val,
                            u_char *ipAddressAddr_val_ptr,
-                           size_t ipAddressAddr_val_ptr_len)
+                           size_t ipAddressAddr_val_ptr_len,
+                           long ipAddressAddr_ifIndex)
 {
     DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
                 "called\n"));
@@ -446,7 +462,8 @@
         ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
                                            ipAddressAddrType_val,
                                            ipAddressAddr_val_ptr,
-                                           ipAddressAddr_val_ptr_len))
+                                           ipAddressAddr_val_ptr_len,
+                                           ipAddressAddr_ifIndex))
         return MFD_ERROR;
 
     /*
Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
--- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.orig	2011-09-28 06:53:47.000000000 +0200
+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h	2012-02-18 21:25:15.751422674 +0100
@@ -273,14 +273,16 @@
                                            long ipAddressAddrType_val,
                                            u_char *ipAddressAddr_val_ptr,
                                            size_t
-                                           ipAddressAddr_val_ptr_len);
+                                           ipAddressAddr_val_ptr_len,
+                                           long ipAddressAddr_ifIndex);
     int             ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
                                                rowreq_ctx,
                                                u_long
                                                ipAddressAddrType_val,
                                                u_char *ipAddressAddr_val_ptr,
                                                size_t
-                                               ipAddressAddr_val_ptr_len);
+                                               ipAddressAddr_val_ptr_len,
+                                               long ipAddressAddr_ifIndex);
 
 
 
