Ignore:
Timestamp:
09/28/09 10:58:05 (11 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:
dfda78f
Parents:
66cf27f
Message:

Be more clear about why we failed to create a socket, so people understand you
need to run as root.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux.c

    r1aa4bf7 r4b6495c3  
    130130                                socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
    131131        if (FORMAT(libtrace->format_data)->fd==-1) {
    132                 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Could not create raw socket");
     132                trace_set_err(libtrace, errno, "Could not create raw socket");
    133133                free(libtrace->format_data);
    134134                return -1;
     
    152152                                (socklen_t)sizeof(addr))==-1) {
    153153                free(libtrace->format_data);
    154                 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Failed to bind to interface %s", libtrace->uridata);
     154                trace_set_err(libtrace, errno, "Failed to bind to interface %s", libtrace->uridata);
    155155                return -1;
    156156        }
     
    258258        if (FORMAT(libtrace->format_data)->filter != NULL)
    259259                free(FORMAT(libtrace->format_data)->filter);
    260         free(libtrace->format_data);
     260        if (libtrace->format_data)
     261                free(libtrace->format_data);
    261262       
    262263        return 0;
Note: See TracChangeset for help on using the changeset viewer.