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

Commit a70486f0 authored by David S. Miller's avatar David S. Miller
Browse files

xfrm: Pass const xfrm_address_t objects to xfrm_state_lookup* and xfrm_find_acq.

parent 85158621
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1350,11 +1350,11 @@ extern void xfrm_state_insert(struct xfrm_state *x);
extern int xfrm_state_add(struct xfrm_state *x);
extern int xfrm_state_add(struct xfrm_state *x);
extern int xfrm_state_update(struct xfrm_state *x);
extern int xfrm_state_update(struct xfrm_state *x);
extern struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark,
extern struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark,
					    xfrm_address_t *daddr, __be32 spi,
					    const xfrm_address_t *daddr, __be32 spi,
					    u8 proto, unsigned short family);
					    u8 proto, unsigned short family);
extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
						   xfrm_address_t *daddr,
						   const xfrm_address_t *daddr,
						   xfrm_address_t *saddr,
						   const xfrm_address_t *saddr,
						   u8 proto,
						   u8 proto,
						   unsigned short family);
						   unsigned short family);
#ifdef CONFIG_XFRM_SUB_POLICY
#ifdef CONFIG_XFRM_SUB_POLICY
@@ -1481,8 +1481,8 @@ u32 xfrm_get_acqseq(void);
extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
				 u8 mode, u32 reqid, u8 proto,
				 u8 mode, u32 reqid, u8 proto,
				 xfrm_address_t *daddr,
				 const xfrm_address_t *daddr,
				 xfrm_address_t *saddr, int create,
				 const xfrm_address_t *saddr, int create,
				 unsigned short family);
				 unsigned short family);
extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);


+8 −4
Original line number Original line Diff line number Diff line
@@ -997,7 +997,11 @@ void xfrm_state_insert(struct xfrm_state *x)
EXPORT_SYMBOL(xfrm_state_insert);
EXPORT_SYMBOL(xfrm_state_insert);


/* xfrm_state_lock is held */
/* xfrm_state_lock is held */
static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m, unsigned short family, u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create)
static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m,
					  unsigned short family, u8 mode,
					  u32 reqid, u8 proto,
					  const xfrm_address_t *daddr,
					  const xfrm_address_t *saddr, int create)
{
{
	unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family);
	unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family);
	struct hlist_node *entry;
	struct hlist_node *entry;
@@ -1375,7 +1379,7 @@ int xfrm_state_check_expire(struct xfrm_state *x)
EXPORT_SYMBOL(xfrm_state_check_expire);
EXPORT_SYMBOL(xfrm_state_check_expire);


struct xfrm_state *
struct xfrm_state *
xfrm_state_lookup(struct net *net, u32 mark, xfrm_address_t *daddr, __be32 spi,
xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi,
		  u8 proto, unsigned short family)
		  u8 proto, unsigned short family)
{
{
	struct xfrm_state *x;
	struct xfrm_state *x;
@@ -1389,7 +1393,7 @@ EXPORT_SYMBOL(xfrm_state_lookup);


struct xfrm_state *
struct xfrm_state *
xfrm_state_lookup_byaddr(struct net *net, u32 mark,
xfrm_state_lookup_byaddr(struct net *net, u32 mark,
			 xfrm_address_t *daddr, xfrm_address_t *saddr,
			 const xfrm_address_t *daddr, const xfrm_address_t *saddr,
			 u8 proto, unsigned short family)
			 u8 proto, unsigned short family)
{
{
	struct xfrm_state *x;
	struct xfrm_state *x;
@@ -1403,7 +1407,7 @@ EXPORT_SYMBOL(xfrm_state_lookup_byaddr);


struct xfrm_state *
struct xfrm_state *
xfrm_find_acq(struct net *net, struct xfrm_mark *mark, u8 mode, u32 reqid, u8 proto,
xfrm_find_acq(struct net *net, struct xfrm_mark *mark, u8 mode, u32 reqid, u8 proto,
	      xfrm_address_t *daddr, xfrm_address_t *saddr,
	      const xfrm_address_t *daddr, const xfrm_address_t *saddr,
	      int create, unsigned short family)
	      int create, unsigned short family)
{
{
	struct xfrm_state *x;
	struct xfrm_state *x;