Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: FreeBSD libnet_pblock_find() problem |
|---|---|
| Date: | Tue, 1 Mar 2005 20:16:23 +0100 |
On Mon, Feb 28, 2005 at 11:30:12PM -0300, Victor Lima wrote:
void
echo_server ( const unsigned char *packet ) {
...
libnet_t *lnet;
...
udp = libnet_build_udp( ntohs( udp_hdr->uh_dport ),
ntohs( udp_hdr->uh_sport ),
LIBNET_UDP_H + strlen( payload ),
0,
payload,
strlen(payload),
lnet,
udp );
if( udp == -1 ) {
fprintf (stderr, "%s: libnet_build_udp() failed: %s\n",
prefix, libnet_geterror(lnet));
goto bad;
}
-----------------------
Whenever I run it, it first blocks on libpcap listening for
packets, after it recieves one it sends the packet to echo_server, where
the appropriate headers are pointed to the correct places in the packet,
so that I can build a response based on the received information. The
code compiles with no problem except that when I run it, libnet_build_udp
returns -1 and the following error message appears:
---
libnet_pblock_find() - couldn't find protocol block
---
Ive googled a bit, and found a few misleading answers none that
solved my problem, so I came here. Hope you guys can help me...
Just a try ...
Your udp variable is not initialised. So I guess it is not 0. Hence,
libnet_build_udp() tries to find the pblock referred by this value,
but cant find it.
Try to set udp = 0; during the initialisation, and it should run
properly.
Fred Raynal
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: performance of libnet-based tools, Frédéric Raynal |
|---|---|
| Next by Date: | Re: FreeBSD libnet_pblock_find() problem, Mike Schiffman |
| Previous by Thread: | FreeBSD libnet_pblock_find() problem, Victor Lima |
| Next by Thread: | Re: FreeBSD libnet_pblock_find() problem, Mike Schiffman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |