Skip Menu |
 

This queue is for tickets about the Net-RawIP CPAN distribution.

Report information
The Basics
Id: 101965
Status: new
Priority: 0/
Queue: Net-RawIP

People
Owner: Nobody in particular
Requestors: GRUBER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] allow source MAC spoofing in BPF
Download (untitled) / with headers
text/plain 948b
From FreeBSD's bpf(4): BIOCSHDRCMPLT BIOCGHDRCMPLT (u_int) Set or get the status of the “header complete” flag. Set to zero if the link level source address should be filled in automatically by the interface output routine. Set to one if the link level source address will be written, as provided, to the wire. This flag is initialized to zero by default. This means that currently it is not possible to spoof source MAC with Net::RawIP on FreeBSD (and likely on other systems using BPF). The attached patch fixes the problem. A side note: I can see that there is a large number of open issues which has not been reacted to for years; the module has not been updated for almost 7 years as well. If you guys do not have tuits for taking care of it, I'd be glad to help, so how about giving me a comaint status? Thanks!
Subject: eth-c.patch
Download eth-c.patch
text/x-diff 679b
--- eth.c.orig 2007-04-03 12:59:40.000000000 +0200 +++ eth.c 2015-02-06 13:45:21.000000000 +0100 @@ -238,6 +238,7 @@ tap(char *dev,unsigned int *my_eth_ip,un int fd,v,s; struct ifreq ifr; (void)strcpy(ifr.ifr_name, dev); + u_int complete; #ifndef _BPF_ if ((fd = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL))) < 0) { @@ -282,6 +283,15 @@ tap(char *dev,unsigned int *my_eth_ip,un croak("(tap) Can't get interface HW address"); } #endif + +#ifdef _BPF_ + complete = 1; + if (ioctl(fd, BIOCSHDRCMPLT, &complete) < 0) { + close(fd); + croak("(tap) cannot set \"header complete\" status"); + } +#endif + return fd; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.