Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a174fd88 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Garzik
Browse files

[PATCH] e1000: fix for dhcp issue



Parse outgoing packets in e1000_transfer_dhcp_info as raw packet even if
protocol bits are set.  pump, for instance causes kernel panic on some
systems, if parsed via udp header.

Thanks to Derrell Lipman <Derrell.Lipman@BacklotTech.com> for reporting and
testing.

Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent d5366d9e
Loading
Loading
Loading
Loading
+1 −13
Original line number Original line Diff line number Diff line
@@ -2621,19 +2621,7 @@ e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb)
			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
			return 0;
			return 0;
	}
	}
	if(htons(ETH_P_IP) == skb->protocol) {
 	if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
		const struct iphdr *ip = skb->nh.iph;
		if(IPPROTO_UDP == ip->protocol) {
			struct udphdr *udp = (struct udphdr *)(skb->h.uh);
			if(ntohs(udp->dest) == 67) {
				offset = (uint8_t *)udp + 8 - skb->data;
				length = skb->len - offset;

				return e1000_mng_write_dhcp_info(hw,
						(uint8_t *)udp + 8, length);
			}
		}
	} else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
		struct ethhdr *eth = (struct ethhdr *) skb->data;
		struct ethhdr *eth = (struct ethhdr *) skb->data;
		if((htons(ETH_P_IP) == eth->h_proto)) {
		if((htons(ETH_P_IP) == eth->h_proto)) {
			const struct iphdr *ip = 
			const struct iphdr *ip =