Package: bandwidthd
Severity: normal
With the following entries in etc/bandwidthd.conf, syslog shows:
Feb 24 10:35:13 debian netmon: Monitoring subnet 255.0.0.0 with netmask
255.0.0.0
Feb 24 10:35:13 debian netmon: Monitoring subnet 255.255.0.0 with netmask
255.255.0.0
Feb 24 10:35:13 debian netmon: Monitoring subnet 255.240.0.0 with netmask
255.240.0.0
It should show:
Feb 24 10:46:53 debian netmon: Monitoring subnet 10.0.0.0 with netmask 255.0.0.0
Feb 24 10:46:53 debian netmon: Monitoring subnet 192.168.0.0 with netmask
255.255.0.0
Feb 24 10:46:53 debian netmon: Monitoring subnet 172.16.0.0 with netmask
255.240.0.0
Cause:
Bandwidthd.c calls inet_ntoa twice in a parameter list. inet_ntoa has static
character buffer: second call overwrites first.
Code now:
// Log list of monitored subnets
for (Counter = 0; Counter < SubnetCount; Counter++)
{
addr.s_addr = ntohl(SubnetTable[Counter].ip);
addr2.s_addr = ntohl(SubnetTable[Counter].mask);
syslog(LOG_INFO, "Monitoring subnet %s with netmask %s",
inet_ntoa(addr), inet_ntoa(addr2));
}
Fixed code:
// Log list of monitored subnets
for (Counter = 0; Counter < SubnetCount; Counter++)
{
char subnet[16], mask[16];
addr.s_addr = ntohl(SubnetTable[Counter].ip);
addr2.s_addr = ntohl(SubnetTable[Counter].mask);
syslog(LOG_INFO, "Monitoring subnet %s with netmask %s",
strncpy(subnet, inet_ntoa(addr), 16), strncpy(mask,
inet_ntoa(addr2), 16));
}
-- System Information:
Debian Release: 6.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: armel (armv5tel)
Kernel: Linux 2.6.35.11 (PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Versions of packages bandwidthd depends on:
ii debconf [debconf-2.0] 1.5.36.1 Debian configuration management sy
ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib
ii libgcc1 1:4.4.5-8 GCC support library
pn libgd2-noxpm | libgd2-xpm <none> (no description available)
ii libpcap0.8 1.1.1-2 system interface for user-level pa
pn libpng12-0 <none> (no description available)
pn ucf <none> (no description available)
bandwidthd recommends no packages.
bandwidthd suggests no packages.
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]