Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare_ip4ip has a bug? #54

Open
liuqi-sun opened this issue Aug 7, 2020 · 0 comments
Open

prepare_ip4ip has a bug? #54

liuqi-sun opened this issue Aug 7, 2020 · 0 comments

Comments

@liuqi-sun
Copy link

void prepare_ip4ip (packetinfo *pi)
{
packetinfo pipi;
memset(&pipi, 0, sizeof(packetinfo));
config.pr_s.ip4ip_recv++;
pipi.pheader = pi->pheader;
pipi.packet = (pi->packet + pi->eth_hlen + (IP_HL(pi->ip4) * 4));
pipi.end_ptr = pi->end_ptr;
if (pi->ip4->ip_p == IP_PROTO_IP4) {
prepare_ip4(&pipi);
parse_ip4(&pipi);
return;
} else {
prepare_ip6(&pipi);
parse_ip6(&pipi);
return;
}
}

In prepare_ip4(&pipi) function,pi->ip4 = (ip4_header *) (pi->packet + pi->eth_hlen) ,why add pi->eth_hlen?pi->packet is IP4 message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant