diff options
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r-- | net/xfrm/xfrm_state.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 9f63edd39346..e40a8862db5d 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1040,7 +1040,7 @@ u32 xfrm_get_acqseq(void) | |||
1040 | EXPORT_SYMBOL(xfrm_get_acqseq); | 1040 | EXPORT_SYMBOL(xfrm_get_acqseq); |
1041 | 1041 | ||
1042 | void | 1042 | void |
1043 | xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi) | 1043 | xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi) |
1044 | { | 1044 | { |
1045 | unsigned int h; | 1045 | unsigned int h; |
1046 | struct xfrm_state *x0; | 1046 | struct xfrm_state *x0; |
@@ -1057,10 +1057,10 @@ xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi) | |||
1057 | x->id.spi = minspi; | 1057 | x->id.spi = minspi; |
1058 | } else { | 1058 | } else { |
1059 | u32 spi = 0; | 1059 | u32 spi = 0; |
1060 | minspi = ntohl(minspi); | 1060 | u32 low = ntohl(minspi); |
1061 | maxspi = ntohl(maxspi); | 1061 | u32 high = ntohl(maxspi); |
1062 | for (h=0; h<maxspi-minspi+1; h++) { | 1062 | for (h=0; h<high-low+1; h++) { |
1063 | spi = minspi + net_random()%(maxspi-minspi+1); | 1063 | spi = low + net_random()%(high-low+1); |
1064 | x0 = xfrm_state_lookup(&x->id.daddr, htonl(spi), x->id.proto, x->props.family); | 1064 | x0 = xfrm_state_lookup(&x->id.daddr, htonl(spi), x->id.proto, x->props.family); |
1065 | if (x0 == NULL) { | 1065 | if (x0 == NULL) { |
1066 | x->id.spi = htonl(spi); | 1066 | x->id.spi = htonl(spi); |