Jump to content

Getting BUSERROR, and I don't know why!

- - - - -

  • Please log in to reply
3 replies to this topic

#1
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
Hello,

Trying to create a project that access a pcap file and prints ETH add, IP add and TCP/UDP. For a reason when I'm doing...
int ether_type = ((int)(pkt_pointer[12]) << 8) | (int)pkt_pointer[13];

		

		if(ether_type == ETHERTYPE_IP)

			offset = 14;

		else 

			offset = ?;

		

		pkt_pointer += offset;
Getting BUS ERROR. I know that error happening on the last line, but can't solve it. Any idea? Also, how many will be the offset in the else statement? Else refer to ETHETYPE_ARP.

Thank you

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,719 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Where are you getting this BUS ERROR thing from?
sudo rm -rf /

#3
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
What does the question mark ('?') on line 6 mean?

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,719 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Good catch, I didn't even see that. That shouldn't even compile.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users