Commit a70486f0e669730bad6713063e3f59e2e870044f

Authored by David S. Miller
1 parent 851586218f

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

Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 13 additions and 9 deletions Side-by-side Diff

... ... @@ -1350,11 +1350,11 @@
1350 1350 extern int xfrm_state_add(struct xfrm_state *x);
1351 1351 extern int xfrm_state_update(struct xfrm_state *x);
1352 1352 extern struct xfrm_state *xfrm_state_lookup(struct net *net, u32 mark,
1353   - xfrm_address_t *daddr, __be32 spi,
  1353 + const xfrm_address_t *daddr, __be32 spi,
1354 1354 u8 proto, unsigned short family);
1355 1355 extern struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1356   - xfrm_address_t *daddr,
1357   - xfrm_address_t *saddr,
  1356 + const xfrm_address_t *daddr,
  1357 + const xfrm_address_t *saddr,
1358 1358 u8 proto,
1359 1359 unsigned short family);
1360 1360 #ifdef CONFIG_XFRM_SUB_POLICY
... ... @@ -1481,8 +1481,8 @@
1481 1481 extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1482 1482 struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
1483 1483 u8 mode, u32 reqid, u8 proto,
1484   - xfrm_address_t *daddr,
1485   - xfrm_address_t *saddr, int create,
  1484 + const xfrm_address_t *daddr,
  1485 + const xfrm_address_t *saddr, int create,
1486 1486 unsigned short family);
1487 1487 extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1488 1488  
net/xfrm/xfrm_state.c
... ... @@ -997,7 +997,11 @@
997 997 EXPORT_SYMBOL(xfrm_state_insert);
998 998  
999 999 /* xfrm_state_lock is held */
1000   -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)
  1000 +static struct xfrm_state *__find_acq_core(struct net *net, struct xfrm_mark *m,
  1001 + unsigned short family, u8 mode,
  1002 + u32 reqid, u8 proto,
  1003 + const xfrm_address_t *daddr,
  1004 + const xfrm_address_t *saddr, int create)
1001 1005 {
1002 1006 unsigned int h = xfrm_dst_hash(net, daddr, saddr, reqid, family);
1003 1007 struct hlist_node *entry;
... ... @@ -1375,7 +1379,7 @@
1375 1379 EXPORT_SYMBOL(xfrm_state_check_expire);
1376 1380  
1377 1381 struct xfrm_state *
1378   -xfrm_state_lookup(struct net *net, u32 mark, xfrm_address_t *daddr, __be32 spi,
  1382 +xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi,
1379 1383 u8 proto, unsigned short family)
1380 1384 {
1381 1385 struct xfrm_state *x;
... ... @@ -1389,7 +1393,7 @@
1389 1393  
1390 1394 struct xfrm_state *
1391 1395 xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1392   - xfrm_address_t *daddr, xfrm_address_t *saddr,
  1396 + const xfrm_address_t *daddr, const xfrm_address_t *saddr,
1393 1397 u8 proto, unsigned short family)
1394 1398 {
1395 1399 struct xfrm_state *x;
... ... @@ -1403,7 +1407,7 @@
1403 1407  
1404 1408 struct xfrm_state *
1405 1409 xfrm_find_acq(struct net *net, struct xfrm_mark *mark, u8 mode, u32 reqid, u8 proto,
1406   - xfrm_address_t *daddr, xfrm_address_t *saddr,
  1410 + const xfrm_address_t *daddr, const xfrm_address_t *saddr,
1407 1411 int create, unsigned short family)
1408 1412 {
1409 1413 struct xfrm_state *x;