aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/net-snmp4/files/patch-ad
blob: bd85f74539195b3f7c387b2f7e2cf3f78c459b9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- agent/mibgroup/mibII/interfaces.c.orig  Fri Dec  1 14:17:21 2000
+++ agent/mibgroup/mibII/interfaces.c   Thu Jan 18 00:04:42 2001
@@ -129,7 +129,7 @@
 #if HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 
-#ifdef freebsd3
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
 #    define USE_SYSCTL_IFLIST
 #else
 # if defined(CTL_NET) && !defined(freebsd2)
@@ -1842,10 +1842,18 @@
            physaddrbuf = 0;
        }
        ifm = (struct if_msghdr *)rtm;
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
+       if (physaddrs != 0) physaddrs[naddrs] = (void*)(ifm + 1);
+       naddrs++;
+#endif
        ilen -= ifm->ifm_msglen;
        cp += ifm->ifm_msglen;
        rtm = (struct rt_msghdr *)cp;
        while (ilen > 0 && rtm->rtm_type == RTM_NEWADDR) {
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
+           ilen -= rtm->rtm_msglen;
+           cp += rtm->rtm_msglen;
+#else
            int is_alias = 0;
            ifam = (struct ifa_msghdr *)rtm;
            ilen -= sizeof(*ifam);
@@ -1868,6 +1876,7 @@
                }
                sa = (struct sockaddr *)cp;
            }
+#endif
            rtm = (struct rt_msghdr *)cp;
        }
    }
@@ -1982,7 +1991,7 @@
        if (ifmd.ifmd_data.ifi_lastchange.tv_sec == 0 &&
            ifmd.ifmd_data.ifi_lastchange.tv_usec == 0) {
            long_return = 0;
-       else if (ifmd.ifmd_data.ifi_lastchange.tv_sec < starttime.tv_sec)
+       } else if (ifmd.ifmd_data.ifi_lastchange.tv_sec < starttime.tv_sec) {
            long_return = 0;
        } else {
            long_return = (u_long)