History

net: tun: split run_ebpf_filter() and pskb_trim() into different "if statement"

No functional change. Just to split the if statement into different conditions to use kfree_skb_reason() to trace the reason later.

Dongli Zhang committed 4 years ago

Commit 45a15d81 parent 736f16d1 file · +4 −1Browse files

Unified · Split

drivers/net/tun.c+4−1
@@ -1086,7 +1086,10 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) · 1085 unmodified lines
10861086 goto drop;
10871087
10881088 len = run_ebpf_filter(tun, skb, len);
1089− if (len == 0 || pskb_trim(skb, len))
1089+ if (len == 0)
1090+ goto drop;
1091+
1092+ if (pskb_trim(skb, len))
10901093 goto drop;
10911094
10921095 if (unlikely(skb_orphan_frags_rx(skb, GFP_ATOMIC)))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t