Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-25-2012, 10:34 AM   #1
LQ Newbie
Registered: Sep 2012
Location: Rome
Distribution: Gentoo
Posts: 5

Rep: Reputation: Disabled
Unhappy Libnet Seg. Fault calling libnet_pblock_new() from libnet_build_tcp()

Solved previous problem i got another one.
In building a TCP packet through libnet function libnet_build_tcp() i got a SIGSEV in calling of libnet_pblock_new() function.

This is what libnet shows:

#0  0x00007ffff7bd0bf9 in libnet_pblock_new () from /usr/lib64/
No symbol table info available.
#1  0x00007ffff7bcda52 in libnet_build_tcp () from /usr/lib64/
No symbol table info available.
#2  0x000000000040172c in caught_packet (user_args=0x7fffffffe458 "\020\060`", 
    cap_header=0x7fffffffe3a0, packet=0x7ffff73d4046 "") at rst_hijack.c:86
        libnet_ctx = 0x7fffffffe458
        bcount = 0
        IPhdr = 0x7ffff73d4054
        TCPhdr = 0x7ffff73d4068
        source_ip = 1008806360678825902
        dest_ip = 9214452798765137930
and the SIGSEV:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd0bf9 in libnet_pblock_new () from /usr/lib64/
My code:

	libnet_build_tcp(htons(TCPhdr->th_dport),//Source port
				htons(TCPhdr->th_sport),//Destination port
				TH_RST,//control flags
				libnet_get_prand(LIBNET_PRu16),//Win Size
				0,//Urgent pointer
				LIBNET_TCP_H,//tcp len
				0,//Payload length
				libnet_ctx,//Libnet Context
				0//Ptag IPv4 Header
TCPhdr is a struct which contains a TCP header, libnet_ctx is a libnet context .

What's wrong with it ?


error, libnet, sigsev

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
seg fault / mem fault - in cron, but works in shell? kauaikat Red Hat 1 04-29-2008 04:24 PM
seg fault / mem fault - in cron, but works in shell? kauaikat Linux - Software 1 04-29-2008 08:21 AM
Qt: seg fault when calling treewidget Ephracis Programming 8 02-23-2007 05:38 AM
C seg fault drigz Programming 5 10-01-2004 03:35 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration