Show
Ignore:
Timestamp:
11/01/07 11:58:18 (14 months ago)
Author:
aturner
Message:

merge -r 1921:1937 from branches/3.2 refs #276

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/sendpacket.c

    r1897 r1938  
    392392    pcap_t *pcap; 
    393393    sendpacket_t *sp; 
    394 /* 
     394#ifdef BIOCSHDRCMPLT 
    395395    u_int spoof_eth_src = 1; 
    396396    int fd; 
    397  */ 
     397#endif 
     398 
    398399    assert(device); 
    399400    assert(errbuf); 
     
    408409    strlcpy(sp->device, device, sizeof(sp->device)); 
    409410    sp->handle.pcap = pcap; 
    410  
    411 /* 
     411     
     412#ifdef BIOCSHDRCMPLT 
     413    /*  
     414     * Only systems using BPF on the backend need this...  
     415     * other systems don't have ioctl and will get compile errors. 
     416     */ 
    412417    fd = pcap_get_selectable_fd(pcap); 
    413     if (ioctl(fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1) { 
     418    if (ioctl(fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1) 
    414419        errx(1, "Unable to enable source MAC spoof support: %s", strerror(errno)); 
    415     } 
    416  */ 
    417      
     420#endif 
    418421    return sp; 
    419422} 
     
    648651    struct bpf_version bv; 
    649652    u_int v; 
    650 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__) 
     653#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) 
    651654    u_int spoof_eth_src = 1; 
    652655#endif 
     
    705708     *  automatic filling of the link level source address. 
    706709     */ 
    707 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__) 
     710#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) 
    708711    if (ioctl(mysocket, BIOCSHDRCMPLT, &spoof_eth_src) == -1) { 
    709712        snprintf(errbuf, SENDPACKET_ERRBUF_SIZE,