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

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

[SK_BUFF]: Introduce udp_hdr(), remove skb->h.uh

parent d9edf9e2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -944,9 +944,9 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb)
	/* And provide the already calculated phcs */
	if (ip_hdr(skb)->protocol == IPPROTO_UDP) {
		flags |= TXFCB_UDP;
		fcb->phcs = skb->h.uh->check;
		fcb->phcs = udp_hdr(skb)->check;
	} else
		fcb->phcs = skb->h.th->check;
		fcb->phcs = udp_hdr(skb)->check;

	/* l3os is the distance between the start of the
	 * frame (skb->data) and the start of the IP hdr.
+1 −1
Original line number Diff line number Diff line
@@ -1422,7 +1422,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
		csoff = ETH_HLEN + (ih->ihl << 2);
		if (proto == IPPROTO_UDP) {
			csoff += offsetof(struct udphdr, check);
			skb->h.uh->check = csum;
			udp_hdr(skb)->check = csum;
		}
		if (proto == IPPROTO_TCP) {
			csoff += offsetof(struct tcphdr, check);
+1 −1
Original line number Diff line number Diff line
@@ -1166,7 +1166,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
		switch (ip_hdr(skb)->protocol) {
		case IPPROTO_UDP:
			cmd_sts |= ETH_UDP_FRAME;
			desc->l4i_chk = skb->h.uh->check;
			desc->l4i_chk = udp_hdr(skb)->check;
			break;
		case IPPROTO_TCP:
			desc->l4i_chk = skb->h.th->check;
+0 −1
Original line number Diff line number Diff line
@@ -238,7 +238,6 @@ struct sk_buff {

	union {
		struct tcphdr	*th;
		struct udphdr	*uh;
		struct icmphdr	*icmph;
		struct iphdr	*ipiph;
		struct ipv6hdr	*ipv6h;
+9 −0
Original line number Diff line number Diff line
@@ -26,6 +26,15 @@ struct udphdr {
	__sum16	check;
};

#ifdef __KERNEL__
#include <linux/skbuff.h>

static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
{
	return (struct udphdr *)skb->h.raw;
}
#endif

/* UDP socket options */
#define UDP_CORK	1	/* Never send partially complete segments */
#define UDP_ENCAP	100	/* Set the socket to accept encapsulated packets */
Loading