* fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
__small_sprintf. * net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for consistency with /proc/net/if_inet6. (if_indextoname): Ditto. (if_nameindex): Ditto.
This commit is contained in:
parent
58014a9b46
commit
7a2c0a0d6b
|
@ -1,3 +1,12 @@
|
||||||
|
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
|
||||||
|
__small_sprintf.
|
||||||
|
* net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for
|
||||||
|
consistency with /proc/net/if_inet6.
|
||||||
|
(if_indextoname): Ditto.
|
||||||
|
(if_nameindex): Ditto.
|
||||||
|
|
||||||
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
|
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
|
* mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
|
||||||
|
|
|
@ -260,14 +260,14 @@ format_procnet_ifinet6 (char *&filebuf)
|
||||||
filesize += sprintf (filebuf + filesize, "%04x",
|
filesize += sprintf (filebuf + filesize, "%04x",
|
||||||
ntohs (sin6->sin6_addr.s6_addr16[i]));
|
ntohs (sin6->sin6_addr.s6_addr16[i]));
|
||||||
filebuf[filesize++] = ' ';
|
filebuf[filesize++] = ' ';
|
||||||
filesize += __small_sprintf (filebuf + filesize,
|
filesize += sprintf (filebuf + filesize,
|
||||||
"%02x %02x %02x %02x %s\n",
|
"%02lx %02x %02x %02x %s\n",
|
||||||
pap->IfIndex ?: pap->Ipv6IfIndex,
|
pap->IfIndex ?: pap->Ipv6IfIndex,
|
||||||
ip_addr_prefix (pua, pap->FirstPrefix),
|
ip_addr_prefix (pua, pap->FirstPrefix),
|
||||||
((struct sockaddr_in6 *)
|
((struct sockaddr_in6 *)
|
||||||
pua->Address.lpSockaddr)->sin6_scope_id,
|
pua->Address.lpSockaddr)->sin6_scope_id,
|
||||||
pua->DadState,
|
pua->DadState,
|
||||||
pap->AdapterName);
|
pap->AdapterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -2048,7 +2048,7 @@ if_nametoindex (const char *name)
|
||||||
for (pap = pa0; pap; pap = pap->Next)
|
for (pap = pa0; pap; pap = pap->Next)
|
||||||
if (strcasematch (lname, pap->AdapterName))
|
if (strcasematch (lname, pap->AdapterName))
|
||||||
{
|
{
|
||||||
index = pap->IfIndex;
|
index = pap->Ipv6IfIndex ?: pap->IfIndex;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free (pa0);
|
free (pa0);
|
||||||
|
@ -2070,7 +2070,7 @@ if_indextoname (unsigned ifindex, char *ifname)
|
||||||
&& get_adapters_addresses (&pa0, AF_UNSPEC))
|
&& get_adapters_addresses (&pa0, AF_UNSPEC))
|
||||||
{
|
{
|
||||||
for (pap = pa0; pap; pap = pap->Next)
|
for (pap = pa0; pap; pap = pap->Next)
|
||||||
if (ifindex == pap->IfIndex)
|
if (ifindex == (pap->Ipv6IfIndex ?: pap->IfIndex))
|
||||||
{
|
{
|
||||||
name = strcpy (ifname, pap->AdapterName);
|
name = strcpy (ifname, pap->AdapterName);
|
||||||
break;
|
break;
|
||||||
|
@ -2110,9 +2110,9 @@ if_nameindex (void)
|
||||||
for (pap = pa0, cnt = 0; pap; pap = pap->Next)
|
for (pap = pa0, cnt = 0; pap; pap = pap->Next)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < cnt; ++i)
|
for (int i = 0; i < cnt; ++i)
|
||||||
if (iflist[i].if_index == (pap->IfIndex ?: pap->Ipv6IfIndex))
|
if (iflist[i].if_index == (pap->Ipv6IfIndex ?: pap->IfIndex))
|
||||||
goto outer_loop;
|
goto outer_loop;
|
||||||
iflist[cnt].if_index = pap->IfIndex ?: pap->Ipv6IfIndex;
|
iflist[cnt].if_index = pap->Ipv6IfIndex ?: pap->IfIndex;
|
||||||
strcpy (iflist[cnt].if_name = ifnamelist[cnt], pap->AdapterName);
|
strcpy (iflist[cnt].if_name = ifnamelist[cnt], pap->AdapterName);
|
||||||
++cnt;
|
++cnt;
|
||||||
outer_loop:
|
outer_loop:
|
||||||
|
|
Loading…
Reference in New Issue