libtins icon indicating copy to clipboard operation
libtins copied to clipboard

Send packet error in OS X

Open Invisible-Boy opened this issue 6 years ago • 0 comments

I write a little demo in my MacBook.

#include <tins/tins.h>
#include <cstdio>
#include <unistd.h>

using namespace Tins;
int main() {
    NetworkInterface iface("lo0");

    EthernetII eth = EthernetII("00:00:00:00:00:03", "00:00:00:00:00:01");
	IP ip = IP("192.168.0.1", "192.168.0.2");
    eth /= ip;

    PacketSender sender;
    
    printf("start \n");
    for(int j=0; j<10; j++)
        sender.send(eth, iface);
    printf("end \n");
}

I use tshark sniff packets has been sent. The result is: image I use brew install and source code install. There is nothing different. The same code I run in linux, result is right.

Invisible-Boy avatar Sep 14 '18 13:09 Invisible-Boy