Changeset 1938 for trunk/src/common/sendpacket.c
- Timestamp:
- 11/01/07 11:58:18 (14 months ago)
- Files:
-
- 1 modified
-
trunk/src/common/sendpacket.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common/sendpacket.c
r1897 r1938 392 392 pcap_t *pcap; 393 393 sendpacket_t *sp; 394 /* 394 #ifdef BIOCSHDRCMPLT 395 395 u_int spoof_eth_src = 1; 396 396 int fd; 397 */ 397 #endif 398 398 399 assert(device); 399 400 assert(errbuf); … … 408 409 strlcpy(sp->device, device, sizeof(sp->device)); 409 410 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 */ 412 417 fd = pcap_get_selectable_fd(pcap); 413 if (ioctl(fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1) {418 if (ioctl(fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1) 414 419 errx(1, "Unable to enable source MAC spoof support: %s", strerror(errno)); 415 } 416 */ 417 420 #endif 418 421 return sp; 419 422 } … … 648 651 struct bpf_version bv; 649 652 u_int v; 650 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)653 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) 651 654 u_int spoof_eth_src = 1; 652 655 #endif … … 705 708 * automatic filling of the link level source address. 706 709 */ 707 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) && !(__APPLE__)710 #if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT) 708 711 if (ioctl(mysocket, BIOCSHDRCMPLT, &spoof_eth_src) == -1) { 709 712 snprintf(errbuf, SENDPACKET_ERRBUF_SIZE,
