drop:
- pr_info("Packet was dropped.");
+ //pr_info("Packet was dropped.");
kfree_skb(skb);
Don't comment it out, remove it.
And maybe think about incriminating a counter.
quoted hunk ↗ jump to hunk
@@ -1003,21 +1031,41 @@ static int gn_rcv(struct sk_buff *skb, struct net_device *dev,
switch (gh->gc_h.ht) {
case CH_HT_GUC:
+ if (!pskb_may_pull(skb, GN_BASE_HEADER_SIZE + sizeof(struct gn_guc_header) + sizeof(struct btp_header)))
+ goto drop;
The netdev coding style asks for lines to be < 80 characters long.
We also have quite a lot of #defines for lengths of various
headers. So maybe add some _HLEN macros.
Andrew