Project

General

Profile

Bug #6212 » 0001-one-extension-header.patch

pablo, 10/06/2023 11:16 AM

View differences:

drivers/net/gtp.c
937 937
static inline void gtp1_push_header(struct sk_buff *skb, struct pdp_ctx *pctx)
938 938
{
939 939
	int payload_len = skb->len;
940
	struct gtp1_header *gtp1;
940
	struct gtp1_header_long *gtp1;
941
	char ext_hdr[4] = { 0x01, 0x00, 0xff, 0x00}; /* extension header */
941 942

  
942
	gtp1 = skb_push(skb, sizeof(*gtp1));
943
	gtp1 = skb_push(skb, sizeof(*gtp1) + sizeof(ext_hdr));
944
	memset(gtp1, 0, sizeof(*gtp1) + sizeof(ext_hdr));
943 945

  
944 946
	/* Bits    8  7  6  5  4  3  2	1
945 947
	 *	  +--+--+--+--+--+--+--+--+
......
951 953
	gtp1->type	= GTP_TPDU;
952 954
	gtp1->length	= htons(payload_len);
953 955
	gtp1->tid	= htonl(pctx->u.v1.o_tei);
956
	gtp1->next	= 0x32;
957

  
958
	gtp1->flags |= GTP1_F_EXTHDR;
959

  
960
	memcpy(gtp1 + 1, ext_hdr, sizeof(ext_hdr));
954 961

  
955 962
	/* TODO: Support for extension header, sequence number and N-PDU.
956 963
	 *	 Update the length field if any of them is available.
(1-1/2)
Add picture from clipboard (Maximum size: 48.8 MB)