简体   繁体   中英

libnet fails to write ip packets

I'm using a program using libnet, and every time I use it, libnet fails to send any packets.

Specifically, the function that fails is : libnet_write_ip. It returns -1 on every call.

Any ideas what may cause that ? I'm on Mac OS X 10.6.4

Thanks so much in advance !

Add the following line after the call to libnet_write_ip. Hopefully, the system itself will tell you what is the cause of the function failure.

perror("libnet_write_ip");

According to the libnet manual, the libnet_write_* functions are for internal use only. What you need to use is libnet_write(). This function will write your packets after you've called your libnet_build_* functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM