Skip to content

Commit

Permalink
Add the missing return value when a packet is dropped. (#134)
Browse files Browse the repository at this point in the history
Co-authored-by: ycchen <[email protected]>
  • Loading branch information
chen042531 and ycchen authored Jan 16, 2025
1 parent be7da93 commit e286cd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gtpu/encap.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ static int gtp5g_fwd_skb_encap(struct sk_buff *skb, struct net_device *dev,

if (gtp1->type != GTPV1_MSG_TYPE_TPDU) {
GTP5G_WAR(dev, "Uplink: GTPv1 msg type is not TPDU\n");
return -1;
return PKT_DROPPED;
}

// Get rid of the GTP-U + UDP headers.
Expand Down Expand Up @@ -927,6 +927,7 @@ static int gtp5g_fwd_skb_encap(struct sk_buff *skb, struct net_device *dev,
ret = netif_rx(skb);
if (ret != NET_RX_SUCCESS) {
GTP5G_ERR(dev, "Uplink: Packet got dropped\n");
return PKT_DROPPED;
}

return PKT_FORWARDED;
Expand Down

0 comments on commit e286cd3

Please sign in to comment.