Commit 759b8d3c authored by Paolo Abeni's avatar Paolo Abeni Committed by Jakub Kicinski
Browse files

geneve: constify geneve_hlen()



Such helper does not modify the argument; constifying it will additionally
simplify later patches.

Additionally move the definition earlier, still for later's patchesi sake.

Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Link: https://patch.msgid.link/ea9e279b9544e8644194508dd9a4320ee455fa95.1769011015.git.pabeni@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ba1b8c97
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -365,6 +365,11 @@ static void geneve_uninit(struct net_device *dev)
	gro_cells_destroy(&geneve->gro_cells);
}

static int geneve_hlen(const struct genevehdr *gh)
{
	return sizeof(*gh) + gh->opt_len * 4;
}

/* Callback from net/ipv4/udp.c to receive packets */
static int geneve_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{
@@ -497,11 +502,6 @@ static struct socket *geneve_create_sock(struct net *net, bool ipv6,
	return sock;
}

static int geneve_hlen(struct genevehdr *gh)
{
	return sizeof(*gh) + gh->opt_len * 4;
}

static struct sk_buff *geneve_gro_receive(struct sock *sk,
					  struct list_head *head,
					  struct sk_buff *skb)