View | Details | Raw Unified | Return to bug 5367
Collapse All | Expand All

(-)net-snmp-5.1.1/agent/mibgroup/mibII/ipAddr.c.ipAdEntIfIndex (-6 / +9 lines)
Lines 200-204 Link Here
200
#else
200
#else
201
    static struct ifnet lowin_ifnet;
201
    static struct ifnet lowin_ifnet;
202
#if defined(linux)
203
    static struct in_ifaddr in_ifaddr;
204
#endif
202
#endif
205
#endif
203
    static struct ifnet ifnet;
206
    static struct ifnet ifnet;
204
#endif                          /* hpux11 */
207
#endif                          /* hpux11 */
Lines 211-224 Link Here
211
    memcpy((char *) current, (char *) vp->name,
214
    memcpy((char *) current, (char *) vp->name,
212
           (int) vp->namelen * sizeof(oid));
215
           (int) vp->namelen * sizeof(oid));
213
216
214
#if !defined(freebsd2) && !defined(hpux11) && !defined(linux)
217
#if !defined(freebsd2) && !defined(hpux11)
215
    Interface_Scan_Init();
218
    Interface_Scan_Init();
216
#else
219
#else
217
    Address_Scan_Init();
220
    Address_Scan_Init();
218
#endif
221
#endif
219
    for (;;) {
222
    for (;;) {
220
223
221
#if !defined(freebsd2) && !defined(hpux11) && !defined(linux)
224
#if !defined(freebsd2) && !defined(hpux11)
222
        if (Interface_Scan_Next(&interface, NULL, &ifnet, &in_ifaddr) == 0)
225
        if (Interface_Scan_Next(&interface, NULL, &ifnet, &in_ifaddr) == 0)
223
            break;
226
            break;
224
#ifdef STRUCT_IFNET_HAS_IF_ADDRLIST
227
#ifdef STRUCT_IFNET_HAS_IF_ADDRLIST
Lines 226-235 Link Here
226
            continue;           /* No address found for interface */
229
            continue;           /* No address found for interface */
227
#endif
230
#endif
228
#else                           /* !freebsd2 && !hpux11 */
231
#else                           /* !freebsd2 && !hpux11 */
229
#if defined(linux)
232
#if !defined(linux)
230
        if (Address_Scan_Next(&interface, &ifnet) == 0)
231
            break;
232
#else
233
        if (Address_Scan_Next(&interface, &in_ifaddr) == 0)
233
        if (Address_Scan_Next(&interface, &in_ifaddr) == 0)
234
            break;
234
            break;
235
#endif
235
#endif
Lines 240-245 Link Here
240
#elif defined(linux) || defined(sunV3)
240
#elif defined(linux) || defined(sunV3)
241
        cp = (u_char *) & (((struct sockaddr_in *) &(ifnet.if_addr))->
241
        cp = (u_char *) & (((struct sockaddr_in *) &(ifnet.if_addr))->
242
                           sin_addr.s_addr);
242
                           sin_addr.s_addr);
243
244
        if (*cp == 0)		/* first octet is zero? 0.x.x.x is not a */
245
            continue;		/* legal address for an interface */
243
#else
246
#else
244
        cp = (u_char *) & (((struct sockaddr_in *) &(in_ifaddr.ia_addr))->
247
        cp = (u_char *) & (((struct sockaddr_in *) &(in_ifaddr.ia_addr))->
245
                           sin_addr.s_addr);
248
                           sin_addr.s_addr);

Return to bug 5367