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

Commit eddc9ec5 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph

parent e023dd64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1668,7 +1668,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
	if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
	    proto == htons(ETH_P_ARP) ||
	    (proto == htons(ETH_P_IP) &&
	     IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) {
	     IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
		tx_type = ETH1394_GASP;
		dest_node = LOCAL_BUS | ALL_NODES;
		max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
+2 −2
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
		if (mss)
			flags |= LargeSend | ((mss & MSSMask) << MSSShift);
		else if (skb->ip_summed == CHECKSUM_PARTIAL) {
			const struct iphdr *ip = skb->nh.iph;
			const struct iphdr *ip = ip_hdr(skb);
			if (ip->protocol == IPPROTO_TCP)
				flags |= IPCS | TCPCS;
			else if (ip->protocol == IPPROTO_UDP)
@@ -825,7 +825,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
		u32 first_len, first_eor;
		dma_addr_t first_mapping;
		int frag, first_entry = entry;
		const struct iphdr *ip = skb->nh.iph;
		const struct iphdr *ip = ip_hdr(skb);

		/* We must give this initial chunk to the device last.
		 * Otherwise we could race with the device.
+8 −7
Original line number Diff line number Diff line
@@ -1294,17 +1294,18 @@ static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,
		}

		if (skb->protocol == ntohs(ETH_P_IP)) {
			skb->nh.iph->tot_len = 0;
			skb->nh.iph->check = 0;
			skb->h.th->check =
			    ~csum_tcpudp_magic(skb->nh.iph->saddr,
					       skb->nh.iph->daddr, 0,
			struct iphdr *iph = ip_hdr(skb);

			iph->tot_len = 0;
			iph->check = 0;
			skb->h.th->check = ~csum_tcpudp_magic(iph->saddr,
							      iph->daddr, 0,
							      IPPROTO_TCP, 0);
			ipofst = skb_network_offset(skb);
			if (ipofst != ENET_HEADER_SIZE) /* 802.3 frame */
				tso->tsopl |= 1 << TSO_PARAM_ETHTYPE_SHIFT;

			tso->tsopl |= (skb->nh.iph->ihl &
			tso->tsopl |= (iph->ihl &
				CSUM_PARAM_IPHL_MASK) << CSUM_PARAM_IPHL_SHIFT;
			tso->tsopl |= ((skb->h.th->doff << 2) &
				TSO_PARAM_TCPHDRLEN_MASK) << TSO_PARAM_TCPHDRLEN_SHIFT;
+9 −9
Original line number Diff line number Diff line
@@ -4513,6 +4513,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
	if ((mss = skb_shinfo(skb)->gso_size) &&
		(skb->len > (bp->dev->mtu + ETH_HLEN))) {
		u32 tcp_opt_len, ip_tcp_len;
		struct iphdr *iph;

		if (skb_header_cloned(skb) &&
		    pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -4529,15 +4530,14 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
		}
		ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);

		skb->nh.iph->check = 0;
		skb->nh.iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
		skb->h.th->check =
			~csum_tcpudp_magic(skb->nh.iph->saddr,
					    skb->nh.iph->daddr,
		iph = ip_hdr(skb);
		iph->check = 0;
		iph->tot_len = htons(mss + ip_tcp_len + tcp_opt_len);
		skb->h.th->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
						      0, IPPROTO_TCP, 0);

		if (tcp_opt_len || (skb->nh.iph->ihl > 5)) {
			vlan_tag_flags |= ((skb->nh.iph->ihl - 5) +
		if (tcp_opt_len || (iph->ihl > 5)) {
			vlan_tag_flags |= ((iph->ihl - 5) +
					   (tcp_opt_len >> 2)) << 8;
		}
	}
+10 −7
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb)
/* Forward declaration */
static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);

static inline u8 _simple_hash(u8 *hash_start, int hash_size)
static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
{
	int i;
	u8 hash = 0;
@@ -1268,7 +1268,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
	int hash_size = 0;
	int do_tx_balance = 1;
	u32 hash_index = 0;
	u8 *hash_start = NULL;
	const u8 *hash_start = NULL;
	int res = 1;

	skb_reset_mac_header(skb);
@@ -1285,15 +1285,18 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
	}

	switch (ntohs(skb->protocol)) {
	case ETH_P_IP:
	case ETH_P_IP: {
		const struct iphdr *iph = ip_hdr(skb);

		if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) ||
		    (skb->nh.iph->daddr == ip_bcast) ||
		    (skb->nh.iph->protocol == IPPROTO_IGMP)) {
		    (iph->daddr == ip_bcast) ||
		    (iph->protocol == IPPROTO_IGMP)) {
			do_tx_balance = 0;
			break;
		}
		hash_start = (char*)&(skb->nh.iph->daddr);
		hash_size = sizeof(skb->nh.iph->daddr);
		hash_start = (char *)&(iph->daddr);
		hash_size = sizeof(iph->daddr);
	}
		break;
	case ETH_P_IPV6:
		if (memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) {
Loading