[tcpdump-workers] pcap_inject and 802.1q subinterfaces on Solaris?

2011-05-19 Thread Tim Sammut
Hi, everyone.

I have a small tool that uses pcap_inject to send ethernet frames on
specific host interfaces. When injecting on a 802.1q virtual interface
on Solaris the frame is ultimately transmitted without the 802.1q header
that should have been add by the host OS. This is Solaris 10 on SPARC
with libpcap 1.1.1, and the same scenario works perfectly on Linux.

Is this something that should work on Solaris too?

Thanks for your help!

hope all is well
tim
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Re: [tcpdump-workers] pcap_inject and 802.1q subinterfaces on Solaris?

2011-05-19 Thread Guy Harris

On May 19, 2011, at 3:33 PM, Tim Sammut wrote:

> I have a small tool that uses pcap_inject to send ethernet frames on
> specific host interfaces. When injecting on a 802.1q virtual interface
> on Solaris the frame is ultimately transmitted without the 802.1q header
> that should have been add by the host OS. This is Solaris 10 on SPARC
> with libpcap 1.1.1, and the same scenario works perfectly on Linux.
> 
> Is this something that should work on Solaris too?

Ultimately, libpcap depends on the OS to provide raw packet capture and 
injection capabilities.  If the Solaris networking stack allows a DLPI device 
bound to a VLAN interface to have packets handed to it with a full Ethernet 
header and to use the Ethernet header but add in the appropriate VLAN header, 
by doing, for example, a special ioctl - and either that ioctl is harmless on 
other interfaces or libpcap can somehow determine whether it needs to make that 
ioctl - then libpcap could (and should) be changed to do that.  If the Solaris 
networking stack doesn't allow that, you're out of luck - you might have to 
open the hardware interface, construct the packets complete with VLAN header, 
and send the packets out on that.

I don't know which of those is the case; a quick look at the Sun^WOracle 
documentation didn't find anything obvious.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Re: [tcpdump-workers] pcap_inject and 802.1q subinterfaces on Solaris?

2011-05-19 Thread Guy Harris

On May 19, 2011, at 7:43 PM, Guy Harris wrote:

> Ultimately, libpcap depends on the OS to provide raw packet capture and 
> injection capabilities.  If the Solaris networking stack allows a DLPI device 
> bound to a VLAN interface to have packets handed to it with a full Ethernet 
> header and to use the Ethernet header but add in the appropriate VLAN header, 
> by doing, for example, a special ioctl - and either that ioctl is harmless on 
> other interfaces or libpcap can somehow determine whether it needs to make 
> that ioctl - then libpcap could (and should) be changed to do that.  If the 
> Solaris networking stack doesn't allow that, you're out of luck - you might 
> have to open the hardware interface, construct the packets complete with VLAN 
> header, and send the packets out on that.

Or, if it can get enough information to synthesize the 802.1q header, libpcap 
could work around it by copying the packet to a private buffer, adding the 
802.1q header, and handing that to the DLPI device.
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.