Most probably there is something wrong with structures definitions. Or you may be trying to process non TCP packet.