Changeset 3ed9a80


Ignore:
Timestamp:
10/16/06 16:50:08 (14 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
4362100
Parents:
0c835956
Message:

Listen to the promisc flags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r99ff3d9 r3ed9a80  
    7777                malloc(sizeof(struct libtrace_format_data_t));
    7878        FORMAT(libtrace->format_data)->fd = -1;
    79         FORMAT(libtrace->format_data)->promisc = 0;
     79        FORMAT(libtrace->format_data)->promisc = -1;
    8080        FORMAT(libtrace->format_data)->snaplen = 65536;
    8181
     
    122122                return -1;
    123123        }
    124         /* enable promisc mode when listening on an interface */
    125         if (addr.sll_ifindex!=0) {
     124
     125        /* If promisc hasn't been specified, set it to "true" if we're
     126         * capturing on one interface, or "false" if we're capturing on
     127         * all interfaces.
     128         */
     129        if (FORMAT(libtrace->format_data)->promisc==-1) {
     130                if (addr.sll_ifindex!=0)
     131                        FORMAT(libtrace->format_data)->promisc=1;
     132                else
     133                        FORMAT(libtrace->format_data)->promisc=0;
     134        }
     135                               
     136        if (FORMAT(libtrace->format_data)->promisc) {
    126137                struct packet_mreq mreq;
    127138                socklen_t socklen = sizeof(mreq);
Note: See TracChangeset for help on using the changeset viewer.