Re: wireguard: problem sending via libpcap's packet socket

2020-07-13 Thread Hans Wippel
On Tue, 30 Jun 2020 21:05:27 -0600 "Jason A. Donenfeld" wrote: > On Sun, Jun 28, 2020 at 2:04 PM Willem de Bruijn > wrote: > > > > On Sat, Jun 27, 2020 at 1:58 AM Jason A. Donenfeld wrote: > > > > > > Hi again Hans, > > > > > > A few remarks: although gre implements header_ops, it looks like >

Re: wireguard: problem sending via libpcap's packet socket

2020-07-01 Thread Willem de Bruijn
> > header_ops looks like the best approach to me, too. The protocol field > > needs to reflect the protocol of the *outer* packet, of course, but if > > I read wg_allowedips_lookup_dst correctly, wireguard maintains the > > same outer protocol as the inner protocol, no sit (6-in-4) and such. > > W

Re: wireguard: problem sending via libpcap's packet socket

2020-06-30 Thread Jason A. Donenfeld
On Sun, Jun 28, 2020 at 2:04 PM Willem de Bruijn wrote: > > On Sat, Jun 27, 2020 at 1:58 AM Jason A. Donenfeld wrote: > > > > Hi again Hans, > > > > A few remarks: although gre implements header_ops, it looks like > > various parts of the networking stack change behavior based on it. I'm > > stil

Re: wireguard: problem sending via libpcap's packet socket

2020-06-29 Thread Willem de Bruijn
On Sat, Jun 27, 2020 at 1:58 AM Jason A. Donenfeld wrote: > > Hi again Hans, > > A few remarks: although gre implements header_ops, it looks like > various parts of the networking stack change behavior based on it. I'm > still analyzing that to understand the extent of the effects. > Something lik

Re: wireguard: problem sending via libpcap's packet socket

2020-06-26 Thread Jason A. Donenfeld
Hi again Hans, A few remarks: although gre implements header_ops, it looks like various parts of the networking stack change behavior based on it. I'm still analyzing that to understand the extent of the effects. Something like

Re: wireguard: problem sending via libpcap's packet socket

2020-06-26 Thread Jason A. Donenfeld
Hi Hans, Your test program appears to be doing: socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)) = 3 sendto(3, "E\0\0+\0\0@\0@\21\267o\300\250\1\1\300\250\1\1\4\322\4\322\0\0272\221\1\2\3\4"..., 43, 0, NULL, 0) = 43 This means we're calling into af_packet's packet_sendmsg->packet_snd, which appear

Re: wireguard: problem sending via libpcap's packet socket

2020-06-26 Thread Jason A. Donenfeld
Oh, I meant to ask earlier: if you've got some easy repro code for this, that'd save a bit of trouble. Jason

Re: wireguard: problem sending via libpcap's packet socket

2020-06-26 Thread Jason A. Donenfeld
Hi Hans, On Fri, Jun 26, 2020 at 2:14 PM Hans Wippel wrote: > while toying around with sending packets with libpcap, I noticed that it > did not work with a wireguard interface in contrast to my regular > ethernet interface. Thanks for letting me know. I'll try to repro and will look if this is