Minor bug fixes:
- direction allocation in promisc mode with no net setting - aggregate protocols if port display is turned off.
This commit is contained in:
2
iftop.c
2
iftop.c
@@ -181,7 +181,7 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
|
|||||||
* it was picked up in promisc mode, and account it as incoming.
|
* it was picked up in promisc mode, and account it as incoming.
|
||||||
*/
|
*/
|
||||||
else if(iptr->ip_src.s_addr < iptr->ip_dst.s_addr) {
|
else if(iptr->ip_src.s_addr < iptr->ip_dst.s_addr) {
|
||||||
assign_addr_pair(&ap, iptr, 0);
|
assign_addr_pair(&ap, iptr, 1);
|
||||||
direction = 0;
|
direction = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
8
ui.c
8
ui.c
@@ -69,9 +69,12 @@ void readable_size(float n, char* buf, int bsize, int ksize, int bytes) {
|
|||||||
if(n >= ksize * ksize) {
|
if(n >= ksize * ksize) {
|
||||||
snprintf(buf, bsize, " %4.2f%s", n / (ksize * ksize), bytes ? "MB" : "M" );
|
snprintf(buf, bsize, " %4.2f%s", n / (ksize * ksize), bytes ? "MB" : "M" );
|
||||||
}
|
}
|
||||||
else if(n >= ksize) {
|
else if(n >= 10 * ksize) {
|
||||||
snprintf(buf, bsize, " %4.1f%s", n / ksize, bytes ? "KB" : "K" );
|
snprintf(buf, bsize, " %4.1f%s", n / ksize, bytes ? "KB" : "K" );
|
||||||
}
|
}
|
||||||
|
else if(n >= ksize) {
|
||||||
|
snprintf(buf, bsize, " %4.2f%s", n / ksize, bytes ? "KB" : "K" );
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
snprintf(buf, bsize, " %4.0f%s", n, bytes ? "B" : "b");
|
snprintf(buf, bsize, " %4.0f%s", n, bytes ? "B" : "b");
|
||||||
}
|
}
|
||||||
@@ -220,6 +223,9 @@ void analyse_data() {
|
|||||||
if(options.showports == OPTION_PORTS_SRC || options.showports == OPTION_PORTS_OFF) {
|
if(options.showports == OPTION_PORTS_SRC || options.showports == OPTION_PORTS_OFF) {
|
||||||
ap.dst_port = 0;
|
ap.dst_port = 0;
|
||||||
}
|
}
|
||||||
|
if(options.showports == OPTION_PORTS_OFF) {
|
||||||
|
ap.protocol = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(hash_find(screen_hash, &ap, (void**)&screen_line) == HASH_STATUS_KEY_NOT_FOUND) {
|
if(hash_find(screen_hash, &ap, (void**)&screen_line) == HASH_STATUS_KEY_NOT_FOUND) {
|
||||||
|
|||||||
Reference in New Issue
Block a user