Skip to contentSkip to conversation

net/ethernet/eth.c - eth_header

PATCH New Vicente Feito 1 participant 1 message Mar 22, 2005 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ethernet/eth.c - eth_header

Hi,
Please consider applying (or droping).
Thank you.

Description: This patch prevent drivers from calling eth_header with a 802.3 frame using a len>1536. In such a case returns -EINVAL, which was hard to choose because the ETH_HLEN is supposed to return.

net/ethernet/eth.c renamed from net/ethernet/eth.c.orig +2 -0
@@ -78,6 +78,8 @@ int eth_header(struct sk_buff *skb, stru
 {
 	struct ethhdr *eth = (struct ethhdr *)skb_push(skb,ETH_HLEN);
 
+	if (type == ETH_P_802_3 && len >= 1536)
+		return -EINVAL;
 	/* 
 	 *	Set the protocol type. For a packet of type ETH_P_802_3 we put the length
 	 *	in here instead. It is up to the 802.2 layer to carry protocol information.