[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GetInterfaceInfo bug fix to make it look at all interfaces
From: |
Tod Oace |
Subject: |
GetInterfaceInfo bug fix to make it look at all interfaces |
Date: |
Tue, 29 Jul 2003 12:25:30 -0700 |
Greetings cfengine maintainers,
I ran into a problem where cfagent (2.0.7p3) wasn't finding any
interface information on a machine whose "netstat -in" output looks
like:
# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts
Oerrs Coll
ni0* 0 none none 0 0 0
0 0
ni1* 0 none none 0 0 0
0 0
lo0 4608 127 127.0.0.1 7514388 0 7514388
0 0
lan0 1500 134.134.67.0 134.134.67.98 1694721 0 821451
0 9832
I did some debugging and discovered that GetInterfaceInfo only looks at
the first interface because it isn't advancing its ifp pointer. This
might also explain the problem that someone was having with cfengine
only paying attention to the loopback interface.
The following patch solved my problem:
--- nameinfo.c.orig Tue Jul 29 11:41:04 2003
+++ nameinfo.c Tue Jul 29 11:42:48 2003
@@ -295,7 +295,7 @@
exit(1);
}
-for (j = 0,len = 0,ifp = list.ifc_req; len < list.ifc_len;
len+=SIZEOF_IFREQ(*ifp),j++)
+for (j = 0,len = 0,ifp = list.ifc_req; len < list.ifc_len;
len+=SIZEOF_IFREQ(*ifp),j++,ifp=&ifbuf[j])
{
if (ifp->ifr_addr.sa_family == 0)
{
--
Tod Oace, Intel Corporation <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- GetInterfaceInfo bug fix to make it look at all interfaces,
Tod Oace <=