Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47677
b: refs/heads/master
c: a716c11
h: refs/heads/master
i:
  47675: fd60c15
v: v3
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Feb 11, 2007
1 parent 6cad33e commit cbe1e39
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8e1d20183bf56f889d60edadd48f54912b9277f
refs/heads/master: a716c1197d608c55adfba45692a890ca64e10df0
94 changes: 47 additions & 47 deletions trunk/net/xfrm/xfrm_algo.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
/*
* xfrm algorithm interface
*
* Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/

Expand All @@ -32,14 +32,14 @@ static struct xfrm_algo_desc aalg_list[] = {
{
.name = "hmac(digest_null)",
.compat = "digest_null",

.uinfo = {
.auth = {
.icv_truncbits = 0,
.icv_fullbits = 0,
}
},

.desc = {
.sadb_alg_id = SADB_X_AALG_NULL,
.sadb_alg_ivlen = 0,
Expand All @@ -57,7 +57,7 @@ static struct xfrm_algo_desc aalg_list[] = {
.icv_fullbits = 128,
}
},

.desc = {
.sadb_alg_id = SADB_AALG_MD5HMAC,
.sadb_alg_ivlen = 0,
Expand Down Expand Up @@ -142,14 +142,14 @@ static struct xfrm_algo_desc ealg_list[] = {
{
.name = "ecb(cipher_null)",
.compat = "cipher_null",

.uinfo = {
.encr = {
.blockbits = 8,
.defkeybits = 0,
}
},

.desc = {
.sadb_alg_id = SADB_EALG_NULL,
.sadb_alg_ivlen = 0,
Expand Down Expand Up @@ -248,22 +248,22 @@ static struct xfrm_algo_desc ealg_list[] = {
}
},
{
.name = "cbc(serpent)",
.compat = "serpent",

.uinfo = {
.encr = {
.blockbits = 128,
.defkeybits = 128,
}
},

.desc = {
.sadb_alg_id = SADB_X_EALG_SERPENTCBC,
.sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256,
}
.name = "cbc(serpent)",
.compat = "serpent",

.uinfo = {
.encr = {
.blockbits = 128,
.defkeybits = 128,
}
},

.desc = {
.sadb_alg_id = SADB_X_EALG_SERPENTCBC,
.sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256,
}
},
{
.name = "cbc(camellia)",
Expand All @@ -283,22 +283,22 @@ static struct xfrm_algo_desc ealg_list[] = {
}
},
{
.name = "cbc(twofish)",
.compat = "twofish",
.uinfo = {
.encr = {
.blockbits = 128,
.defkeybits = 128,
}
},

.desc = {
.sadb_alg_id = SADB_X_EALG_TWOFISHCBC,
.sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256
}
.name = "cbc(twofish)",
.compat = "twofish",

.uinfo = {
.encr = {
.blockbits = 128,
.defkeybits = 128,
}
},

.desc = {
.sadb_alg_id = SADB_X_EALG_TWOFISHCBC,
.sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256
}
},
};

Expand Down Expand Up @@ -478,7 +478,7 @@ void xfrm_probe_algs(void)
{
#ifdef CONFIG_CRYPTO
int i, status;

BUG_ON(in_softirq());

for (i = 0; i < aalg_entries(); i++) {
Expand All @@ -487,14 +487,14 @@ void xfrm_probe_algs(void)
if (aalg_list[i].available != status)
aalg_list[i].available = status;
}

for (i = 0; i < ealg_entries(); i++) {
status = crypto_has_blkcipher(ealg_list[i].name, 0,
CRYPTO_ALG_ASYNC);
if (ealg_list[i].available != status)
ealg_list[i].available = status;
}

for (i = 0; i < calg_entries(); i++) {
status = crypto_has_comp(calg_list[i].name, 0,
CRYPTO_ALG_ASYNC);
Expand Down Expand Up @@ -541,15 +541,15 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > 0) {
if (copy > len)
copy = len;

sg.page = virt_to_page(skb->data + offset);
sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
sg.length = copy;

err = icv_update(desc, &sg, copy);
if (unlikely(err))
return err;

if ((len -= copy) == 0)
return 0;
offset += copy;
Expand All @@ -566,11 +566,11 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,

if (copy > len)
copy = len;

sg.page = frag->page;
sg.offset = frag->page_offset + offset-start;
sg.length = copy;

err = icv_update(desc, &sg, copy);
if (unlikely(err))
return err;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/xfrm/xfrm_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Changes:
* YOSHIFUJI Hideaki @USAGI
* Split up af-specific portion
*
*
*/

#include <linux/slab.h>
Expand Down
40 changes: 20 additions & 20 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* xfrm_policy.c
*
* Changes:
Expand Down Expand Up @@ -151,7 +151,7 @@ struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
return type;
}

int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl,
int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl,
unsigned short family)
{
struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family);
Expand Down Expand Up @@ -262,7 +262,7 @@ static inline unsigned long make_jiffies(long secs)
if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
return MAX_SCHEDULE_TIMEOUT-1;
else
return secs*HZ;
return secs*HZ;
}

static void xfrm_policy_timer(unsigned long data)
Expand Down Expand Up @@ -1024,17 +1024,17 @@ static int xfrm_policy_lookup(struct flowi *fl, u16 family, u8 dir,
static inline int policy_to_flow_dir(int dir)
{
if (XFRM_POLICY_IN == FLOW_DIR_IN &&
XFRM_POLICY_OUT == FLOW_DIR_OUT &&
XFRM_POLICY_FWD == FLOW_DIR_FWD)
return dir;
switch (dir) {
default:
case XFRM_POLICY_IN:
return FLOW_DIR_IN;
case XFRM_POLICY_OUT:
return FLOW_DIR_OUT;
case XFRM_POLICY_FWD:
return FLOW_DIR_FWD;
XFRM_POLICY_OUT == FLOW_DIR_OUT &&
XFRM_POLICY_FWD == FLOW_DIR_FWD)
return dir;
switch (dir) {
default:
case XFRM_POLICY_IN:
return FLOW_DIR_IN;
case XFRM_POLICY_OUT:
return FLOW_DIR_OUT;
case XFRM_POLICY_FWD:
return FLOW_DIR_FWD;
};
}

Expand All @@ -1044,9 +1044,9 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struc

read_lock_bh(&xfrm_policy_lock);
if ((pol = sk->sk_policy[dir]) != NULL) {
int match = xfrm_selector_match(&pol->selector, fl,
int match = xfrm_selector_match(&pol->selector, fl,
sk->sk_family);
int err = 0;
int err = 0;

if (match) {
err = security_xfrm_policy_lookup(pol, fl->secid,
Expand Down Expand Up @@ -1511,7 +1511,7 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
}
*dst_p = dst;
dst_release(dst_orig);
xfrm_pols_put(pols, npols);
xfrm_pols_put(pols, npols);
return 0;

error:
Expand Down Expand Up @@ -1546,7 +1546,7 @@ xfrm_secpath_reject(int idx, struct sk_buff *skb, struct flowi *fl)
*/

static inline int
xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
xfrm_state_ok(struct xfrm_tmpl *tmpl, struct xfrm_state *x,
unsigned short family)
{
if (xfrm_state_kern(x))
Expand Down Expand Up @@ -1619,7 +1619,7 @@ static inline int secpath_has_nontransport(struct sec_path *sp, int k, int *idxp
return 0;
}

int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
unsigned short family)
{
struct xfrm_policy *pol;
Expand Down Expand Up @@ -2243,7 +2243,7 @@ static int xfrm_migrate_selector_match(struct xfrm_selector *sel_cmp,
if (sel_cmp->proto == IPSEC_ULPROTO_ANY) {
if (sel_tgt->family == sel_cmp->family &&
xfrm_addr_cmp(&sel_tgt->daddr, &sel_cmp->daddr,
sel_cmp->family) == 0 &&
sel_cmp->family) == 0 &&
xfrm_addr_cmp(&sel_tgt->saddr, &sel_cmp->saddr,
sel_cmp->family) == 0 &&
sel_tgt->prefixlen_d == sel_cmp->prefixlen_d &&
Expand Down
18 changes: 9 additions & 9 deletions trunk/net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static inline unsigned long make_jiffies(long secs)
if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
return MAX_SCHEDULE_TIMEOUT-1;
else
return secs*HZ;
return secs*HZ;
}

static void xfrm_timer_handler(unsigned long data)
Expand Down Expand Up @@ -523,7 +523,7 @@ static void xfrm_hash_grow_check(int have_hash_collision)
}

struct xfrm_state *
xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
struct flowi *fl, struct xfrm_tmpl *tmpl,
struct xfrm_policy *pol, int *err,
unsigned short family)
Expand All @@ -534,7 +534,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
int acquire_in_progress = 0;
int error = 0;
struct xfrm_state *best = NULL;

spin_lock_bh(&xfrm_state_lock);
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
if (x->props.family == family &&
Expand Down Expand Up @@ -570,7 +570,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
acquire_in_progress = 1;
} else if (x->km.state == XFRM_STATE_ERROR ||
x->km.state == XFRM_STATE_EXPIRED) {
if (xfrm_selector_match(&x->sel, fl, family) &&
if (xfrm_selector_match(&x->sel, fl, family) &&
security_xfrm_state_pol_flow_match(x, pol, fl))
error = -ESRCH;
}
Expand Down Expand Up @@ -866,7 +866,7 @@ struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
}
x->props.calgo = orig->props.calgo;

if (orig->encap) {
if (orig->encap) {
x->encap = kmemdup(orig->encap, sizeof(*x->encap), GFP_KERNEL);
if (!x->encap)
goto error;
Expand Down Expand Up @@ -947,7 +947,7 @@ struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m)
}
}

return NULL;
return NULL;
}
EXPORT_SYMBOL(xfrm_migrate_state_find);

Expand Down Expand Up @@ -1121,8 +1121,8 @@ xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr,
EXPORT_SYMBOL(xfrm_state_lookup_byaddr);

struct xfrm_state *
xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
xfrm_address_t *daddr, xfrm_address_t *saddr,
xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
xfrm_address_t *daddr, xfrm_address_t *saddr,
int create, unsigned short family)
{
struct xfrm_state *x;
Expand Down Expand Up @@ -1738,7 +1738,7 @@ int xfrm_init_state(struct xfrm_state *x)
}

EXPORT_SYMBOL(xfrm_init_state);

void __init xfrm_state_init(void)
{
unsigned int sz;
Expand Down
Loading

0 comments on commit cbe1e39

Please sign in to comment.