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

fix: remove all the header in the correct way #79

Merged
merged 8 commits into from
May 18, 2023

Conversation

Roy-Hu
Copy link
Contributor

@Roy-Hu Roy-Hu commented May 9, 2023

  1. perform ip4_rm_header before the gtp5g_push_header in the gtp5g_fwd_skb_ipv4 to prevent calculate the volume of the pushed header
  2. Not sure why pskb_may_pull in gtp1u_udp_encap_recv do not move the skb->data & skb-len forward hdrlen. Therefore, instead of deducting the Ipv4 & TCP header under GPRS tunneling protocol, it repeatedly deducts the hdrlen.

src/gtpu/pktinfo.c Outdated Show resolved Hide resolved
src/gtpu/pktinfo.c Outdated Show resolved Hide resolved
src/gtpu/pktinfo.c Outdated Show resolved Hide resolved
src/gtpu/pktinfo.c Outdated Show resolved Hide resolved
src/gtpu/pktinfo.c Outdated Show resolved Hide resolved
}
volume = skb->len;
if (hdrlen == 0) {
// packets from N6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// packets without gtp header

iph = ip_hdr(skb);
volume -= network_and_transport_header_len(skb_copy);
} else if (hdrlen > 0) {
// packets from N3/N9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// packets with gtp header

volume = skb->len;
if (hdrlen == 0) {
// packets without gtp header
iph = ip_hdr(skb);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iph no use anymore and can be removed.

@tim-ywliu tim-ywliu merged commit 0e63943 into free5gc:master May 18, 2023
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

Successfully merging this pull request may close these issues.

4 participants