1

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 !

otibom
  • 11
  • 1

2 Answers2

0

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");
pmg
  • 106,608
  • 13
  • 126
  • 198
  • I get :"Invalid argument". But it's strange, because the program is not mine and is supposed to work. – otibom Nov 07 '10 at 20:34
  • If you edit your question and include a bit of code (the call, the setting up of parameters, and anything else relevant) I'm sure a *stacker* with libnet experience will help you find the cause for failure. – pmg Nov 07 '10 at 21:20
0

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.

Nadeem Douba
  • 982
  • 8
  • 8