Code? What code? I don't see any code. It's near impossible for us to troubleshoot this without code.
Nobody. Not because your question is impossible to answer, because we don't have enough information.Who could tell me why?and how to correct it?thank you very much.
What are you communicating with or using to generate the packets for testing? Are you sure that doesn't have a bug?
Read the following man pages: socket(7), ip(7), packet(7), raw(7)
The 7 is for section 7, so do "man 7 socket".
Here's a StackOverflow article that looks related. Maybe some of the info there will give you some clues.