>Number:         148065
>Category:       misc
>Synopsis:       rate program put interface in promiscuous mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 22 12:10:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Artem Roshenia
>Release:        8.0-RELEASE
>Organization:
Global Outsource
>Environment:
FreeBSD gw.it.local 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Jun 12 12:54:28 
EEST 2010     [email protected]:/usr/obj/usr/src/sys/ARTEM  i386
>Description:
/usr/ports/net-mgmt/rate program put interface in promiscuous mode
>How-To-Repeat:
Always
>Fix:
just put my patch

Patch attached with submission follows:

--- work/rate-0.9/rate.c        2003-08-20 18:22:28.000000000 +0300
+++ /root/rate/rate.c   2010-06-22 14:57:31.000000000 +0300
@@ -74,6 +74,7 @@
 int opt_cls = 0;
 int opt_dns = 1;
 int opt_cols = 80;
+int opt_promisc = 0;
 
 #ifdef HAVE_REGEX
 char * opt_regex = NULL;
@@ -214,6 +215,7 @@
        printf("  -p <pref> Datalink layer header size (gets substracted from 
each packet size, default: 14)\n");
        printf("  -s <b>    Capture l bytes (default: 40)\n");
        printf("  -i <int>  Bind to interface <int> - default eth0\n");
+       printf("  -P        Bring the interface into promiscuous mode\n");
        printf("  -n        Numeric IPs. Don't do reverse DNS lookups.\n");
        printf("  -c        Use colors (ANSI-compatible) whenever possible.\n");
        printf("  -v        Print exact values, do not use SI prefixes.\n");
@@ -264,7 +266,7 @@
                }
        }
        
-       while((c = getopt(argc, argv, "?hr:q:f:p:s:i:S:x:0:glkcvwenRATE")) != 
EOF)
+       while((c = getopt(argc, argv, "?hr:q:f:p:s:i:P:S:x:0:glkcvwenRATE")) != 
EOF)
        {
                if(c == 'R' || c == 'A' || c == 'T' || c == 'E')
                        break;
@@ -284,6 +286,7 @@
                        case 'k': opt_onkeyboard = 1; break;
                        case 'c': opt_color = 1; break;
                        case 'v': opt_human = 0; break;
+                       case 'P': opt_promisc = 1; break;
                        case 'e': opt_separator = 1; break;
                        case 'w': opt_cls = 1; break;
                        case 'n': opt_dns = 0; break;
@@ -311,7 +314,7 @@
                }
        }
 
-       if((handle = pcap_open_live(interface, 2048, -1, 50, ebuff))==NULL)
+       if((handle = pcap_open_live(interface, 2048, opt_promisc, 50, 
ebuff))==NULL)
        {
                fprintf(stderr, "pcap_open_live(): %s\n", ebuff);
                return(0);


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to