提交 a716c119 编写于 作者: Y YOSHIFUJI Hideaki 提交者: David S. Miller

[NET] XFRM: Fix whitespace errors.

Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f8e1d201
/* /*
* xfrm algorithm interface * xfrm algorithm interface
* *
* Copyright (c) 2002 James Morris <jmorris@intercode.com.au> * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
* *
* This program is free software; you can redistribute it and/or modify it * 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 * 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. * any later version.
*/ */
...@@ -32,14 +32,14 @@ static struct xfrm_algo_desc aalg_list[] = { ...@@ -32,14 +32,14 @@ static struct xfrm_algo_desc aalg_list[] = {
{ {
.name = "hmac(digest_null)", .name = "hmac(digest_null)",
.compat = "digest_null", .compat = "digest_null",
.uinfo = { .uinfo = {
.auth = { .auth = {
.icv_truncbits = 0, .icv_truncbits = 0,
.icv_fullbits = 0, .icv_fullbits = 0,
} }
}, },
.desc = { .desc = {
.sadb_alg_id = SADB_X_AALG_NULL, .sadb_alg_id = SADB_X_AALG_NULL,
.sadb_alg_ivlen = 0, .sadb_alg_ivlen = 0,
...@@ -57,7 +57,7 @@ static struct xfrm_algo_desc aalg_list[] = { ...@@ -57,7 +57,7 @@ static struct xfrm_algo_desc aalg_list[] = {
.icv_fullbits = 128, .icv_fullbits = 128,
} }
}, },
.desc = { .desc = {
.sadb_alg_id = SADB_AALG_MD5HMAC, .sadb_alg_id = SADB_AALG_MD5HMAC,
.sadb_alg_ivlen = 0, .sadb_alg_ivlen = 0,
...@@ -142,14 +142,14 @@ static struct xfrm_algo_desc ealg_list[] = { ...@@ -142,14 +142,14 @@ static struct xfrm_algo_desc ealg_list[] = {
{ {
.name = "ecb(cipher_null)", .name = "ecb(cipher_null)",
.compat = "cipher_null", .compat = "cipher_null",
.uinfo = { .uinfo = {
.encr = { .encr = {
.blockbits = 8, .blockbits = 8,
.defkeybits = 0, .defkeybits = 0,
} }
}, },
.desc = { .desc = {
.sadb_alg_id = SADB_EALG_NULL, .sadb_alg_id = SADB_EALG_NULL,
.sadb_alg_ivlen = 0, .sadb_alg_ivlen = 0,
...@@ -248,22 +248,22 @@ static struct xfrm_algo_desc ealg_list[] = { ...@@ -248,22 +248,22 @@ static struct xfrm_algo_desc ealg_list[] = {
} }
}, },
{ {
.name = "cbc(serpent)", .name = "cbc(serpent)",
.compat = "serpent", .compat = "serpent",
.uinfo = { .uinfo = {
.encr = { .encr = {
.blockbits = 128, .blockbits = 128,
.defkeybits = 128, .defkeybits = 128,
} }
}, },
.desc = { .desc = {
.sadb_alg_id = SADB_X_EALG_SERPENTCBC, .sadb_alg_id = SADB_X_EALG_SERPENTCBC,
.sadb_alg_ivlen = 8, .sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128, .sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256, .sadb_alg_maxbits = 256,
} }
}, },
{ {
.name = "cbc(camellia)", .name = "cbc(camellia)",
...@@ -283,22 +283,22 @@ static struct xfrm_algo_desc ealg_list[] = { ...@@ -283,22 +283,22 @@ static struct xfrm_algo_desc ealg_list[] = {
} }
}, },
{ {
.name = "cbc(twofish)", .name = "cbc(twofish)",
.compat = "twofish", .compat = "twofish",
.uinfo = { .uinfo = {
.encr = { .encr = {
.blockbits = 128, .blockbits = 128,
.defkeybits = 128, .defkeybits = 128,
} }
}, },
.desc = { .desc = {
.sadb_alg_id = SADB_X_EALG_TWOFISHCBC, .sadb_alg_id = SADB_X_EALG_TWOFISHCBC,
.sadb_alg_ivlen = 8, .sadb_alg_ivlen = 8,
.sadb_alg_minbits = 128, .sadb_alg_minbits = 128,
.sadb_alg_maxbits = 256 .sadb_alg_maxbits = 256
} }
}, },
}; };
...@@ -478,7 +478,7 @@ void xfrm_probe_algs(void) ...@@ -478,7 +478,7 @@ void xfrm_probe_algs(void)
{ {
#ifdef CONFIG_CRYPTO #ifdef CONFIG_CRYPTO
int i, status; int i, status;
BUG_ON(in_softirq()); BUG_ON(in_softirq());
for (i = 0; i < aalg_entries(); i++) { for (i = 0; i < aalg_entries(); i++) {
...@@ -487,14 +487,14 @@ void xfrm_probe_algs(void) ...@@ -487,14 +487,14 @@ void xfrm_probe_algs(void)
if (aalg_list[i].available != status) if (aalg_list[i].available != status)
aalg_list[i].available = status; aalg_list[i].available = status;
} }
for (i = 0; i < ealg_entries(); i++) { for (i = 0; i < ealg_entries(); i++) {
status = crypto_has_blkcipher(ealg_list[i].name, 0, status = crypto_has_blkcipher(ealg_list[i].name, 0,
CRYPTO_ALG_ASYNC); CRYPTO_ALG_ASYNC);
if (ealg_list[i].available != status) if (ealg_list[i].available != status)
ealg_list[i].available = status; ealg_list[i].available = status;
} }
for (i = 0; i < calg_entries(); i++) { for (i = 0; i < calg_entries(); i++) {
status = crypto_has_comp(calg_list[i].name, 0, status = crypto_has_comp(calg_list[i].name, 0,
CRYPTO_ALG_ASYNC); CRYPTO_ALG_ASYNC);
...@@ -541,15 +541,15 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, ...@@ -541,15 +541,15 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > 0) { if (copy > 0) {
if (copy > len) if (copy > len)
copy = len; copy = len;
sg.page = virt_to_page(skb->data + offset); sg.page = virt_to_page(skb->data + offset);
sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE; sg.offset = (unsigned long)(skb->data + offset) % PAGE_SIZE;
sg.length = copy; sg.length = copy;
err = icv_update(desc, &sg, copy); err = icv_update(desc, &sg, copy);
if (unlikely(err)) if (unlikely(err))
return err; return err;
if ((len -= copy) == 0) if ((len -= copy) == 0)
return 0; return 0;
offset += copy; offset += copy;
...@@ -566,11 +566,11 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc, ...@@ -566,11 +566,11 @@ int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *desc,
if (copy > len) if (copy > len)
copy = len; copy = len;
sg.page = frag->page; sg.page = frag->page;
sg.offset = frag->page_offset + offset-start; sg.offset = frag->page_offset + offset-start;
sg.length = copy; sg.length = copy;
err = icv_update(desc, &sg, copy); err = icv_update(desc, &sg, copy);
if (unlikely(err)) if (unlikely(err))
return err; return err;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Changes: * Changes:
* YOSHIFUJI Hideaki @USAGI * YOSHIFUJI Hideaki @USAGI
* Split up af-specific portion * Split up af-specific portion
* *
*/ */
#include <linux/slab.h> #include <linux/slab.h>
......
/* /*
* xfrm_policy.c * xfrm_policy.c
* *
* Changes: * Changes:
...@@ -151,7 +151,7 @@ struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) ...@@ -151,7 +151,7 @@ struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family)
return type; 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) unsigned short family)
{ {
struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family); struct xfrm_policy_afinfo *afinfo = xfrm_policy_get_afinfo(family);
...@@ -262,7 +262,7 @@ static inline unsigned long make_jiffies(long secs) ...@@ -262,7 +262,7 @@ static inline unsigned long make_jiffies(long secs)
if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ) if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
return MAX_SCHEDULE_TIMEOUT-1; return MAX_SCHEDULE_TIMEOUT-1;
else else
return secs*HZ; return secs*HZ;
} }
static void xfrm_policy_timer(unsigned long data) static void xfrm_policy_timer(unsigned long data)
...@@ -1024,17 +1024,17 @@ static int xfrm_policy_lookup(struct flowi *fl, u16 family, u8 dir, ...@@ -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) static inline int policy_to_flow_dir(int dir)
{ {
if (XFRM_POLICY_IN == FLOW_DIR_IN && if (XFRM_POLICY_IN == FLOW_DIR_IN &&
XFRM_POLICY_OUT == FLOW_DIR_OUT && XFRM_POLICY_OUT == FLOW_DIR_OUT &&
XFRM_POLICY_FWD == FLOW_DIR_FWD) XFRM_POLICY_FWD == FLOW_DIR_FWD)
return dir; return dir;
switch (dir) { switch (dir) {
default: default:
case XFRM_POLICY_IN: case XFRM_POLICY_IN:
return FLOW_DIR_IN; return FLOW_DIR_IN;
case XFRM_POLICY_OUT: case XFRM_POLICY_OUT:
return FLOW_DIR_OUT; return FLOW_DIR_OUT;
case XFRM_POLICY_FWD: case XFRM_POLICY_FWD:
return FLOW_DIR_FWD; return FLOW_DIR_FWD;
}; };
} }
...@@ -1044,9 +1044,9 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struc ...@@ -1044,9 +1044,9 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struc
read_lock_bh(&xfrm_policy_lock); read_lock_bh(&xfrm_policy_lock);
if ((pol = sk->sk_policy[dir]) != NULL) { 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); sk->sk_family);
int err = 0; int err = 0;
if (match) { if (match) {
err = security_xfrm_policy_lookup(pol, fl->secid, err = security_xfrm_policy_lookup(pol, fl->secid,
...@@ -1511,7 +1511,7 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, ...@@ -1511,7 +1511,7 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
} }
*dst_p = dst; *dst_p = dst;
dst_release(dst_orig); dst_release(dst_orig);
xfrm_pols_put(pols, npols); xfrm_pols_put(pols, npols);
return 0; return 0;
error: error:
...@@ -1546,7 +1546,7 @@ xfrm_secpath_reject(int idx, struct sk_buff *skb, struct flowi *fl) ...@@ -1546,7 +1546,7 @@ xfrm_secpath_reject(int idx, struct sk_buff *skb, struct flowi *fl)
*/ */
static inline int 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) unsigned short family)
{ {
if (xfrm_state_kern(x)) if (xfrm_state_kern(x))
...@@ -1619,7 +1619,7 @@ static inline int secpath_has_nontransport(struct sec_path *sp, int k, int *idxp ...@@ -1619,7 +1619,7 @@ static inline int secpath_has_nontransport(struct sec_path *sp, int k, int *idxp
return 0; 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) unsigned short family)
{ {
struct xfrm_policy *pol; struct xfrm_policy *pol;
...@@ -2243,7 +2243,7 @@ static int xfrm_migrate_selector_match(struct xfrm_selector *sel_cmp, ...@@ -2243,7 +2243,7 @@ static int xfrm_migrate_selector_match(struct xfrm_selector *sel_cmp,
if (sel_cmp->proto == IPSEC_ULPROTO_ANY) { if (sel_cmp->proto == IPSEC_ULPROTO_ANY) {
if (sel_tgt->family == sel_cmp->family && if (sel_tgt->family == sel_cmp->family &&
xfrm_addr_cmp(&sel_tgt->daddr, &sel_cmp->daddr, 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, xfrm_addr_cmp(&sel_tgt->saddr, &sel_cmp->saddr,
sel_cmp->family) == 0 && sel_cmp->family) == 0 &&
sel_tgt->prefixlen_d == sel_cmp->prefixlen_d && sel_tgt->prefixlen_d == sel_cmp->prefixlen_d &&
......
...@@ -227,7 +227,7 @@ static inline unsigned long make_jiffies(long secs) ...@@ -227,7 +227,7 @@ static inline unsigned long make_jiffies(long secs)
if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ) if (secs >= (MAX_SCHEDULE_TIMEOUT-1)/HZ)
return MAX_SCHEDULE_TIMEOUT-1; return MAX_SCHEDULE_TIMEOUT-1;
else else
return secs*HZ; return secs*HZ;
} }
static void xfrm_timer_handler(unsigned long data) static void xfrm_timer_handler(unsigned long data)
...@@ -523,7 +523,7 @@ static void xfrm_hash_grow_check(int have_hash_collision) ...@@ -523,7 +523,7 @@ static void xfrm_hash_grow_check(int have_hash_collision)
} }
struct xfrm_state * 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 flowi *fl, struct xfrm_tmpl *tmpl,
struct xfrm_policy *pol, int *err, struct xfrm_policy *pol, int *err,
unsigned short family) unsigned short family)
...@@ -534,7 +534,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, ...@@ -534,7 +534,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
int acquire_in_progress = 0; int acquire_in_progress = 0;
int error = 0; int error = 0;
struct xfrm_state *best = NULL; struct xfrm_state *best = NULL;
spin_lock_bh(&xfrm_state_lock); spin_lock_bh(&xfrm_state_lock);
hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) {
if (x->props.family == family && if (x->props.family == family &&
...@@ -570,7 +570,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, ...@@ -570,7 +570,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
acquire_in_progress = 1; acquire_in_progress = 1;
} else if (x->km.state == XFRM_STATE_ERROR || } else if (x->km.state == XFRM_STATE_ERROR ||
x->km.state == XFRM_STATE_EXPIRED) { 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)) security_xfrm_state_pol_flow_match(x, pol, fl))
error = -ESRCH; error = -ESRCH;
} }
...@@ -866,7 +866,7 @@ struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp) ...@@ -866,7 +866,7 @@ struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig, int *errp)
} }
x->props.calgo = orig->props.calgo; x->props.calgo = orig->props.calgo;
if (orig->encap) { if (orig->encap) {
x->encap = kmemdup(orig->encap, sizeof(*x->encap), GFP_KERNEL); x->encap = kmemdup(orig->encap, sizeof(*x->encap), GFP_KERNEL);
if (!x->encap) if (!x->encap)
goto error; goto error;
...@@ -947,7 +947,7 @@ struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m) ...@@ -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); EXPORT_SYMBOL(xfrm_migrate_state_find);
...@@ -1121,8 +1121,8 @@ xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr, ...@@ -1121,8 +1121,8 @@ xfrm_state_lookup_byaddr(xfrm_address_t *daddr, xfrm_address_t *saddr,
EXPORT_SYMBOL(xfrm_state_lookup_byaddr); EXPORT_SYMBOL(xfrm_state_lookup_byaddr);
struct xfrm_state * struct xfrm_state *
xfrm_find_acq(u8 mode, u32 reqid, u8 proto, xfrm_find_acq(u8 mode, u32 reqid, u8 proto,
xfrm_address_t *daddr, xfrm_address_t *saddr, xfrm_address_t *daddr, xfrm_address_t *saddr,
int create, unsigned short family) int create, unsigned short family)
{ {
struct xfrm_state *x; struct xfrm_state *x;
...@@ -1738,7 +1738,7 @@ int xfrm_init_state(struct xfrm_state *x) ...@@ -1738,7 +1738,7 @@ int xfrm_init_state(struct xfrm_state *x)
} }
EXPORT_SYMBOL(xfrm_init_state); EXPORT_SYMBOL(xfrm_init_state);
void __init xfrm_state_init(void) void __init xfrm_state_init(void)
{ {
unsigned int sz; unsigned int sz;
......
...@@ -48,7 +48,7 @@ static int verify_one_alg(struct rtattr **xfrma, enum xfrm_attr_type_t type) ...@@ -48,7 +48,7 @@ static int verify_one_alg(struct rtattr **xfrma, enum xfrm_attr_type_t type)
algp = RTA_DATA(rt); algp = RTA_DATA(rt);
len -= (algp->alg_key_len + 7U) / 8; len -= (algp->alg_key_len + 7U) / 8;
if (len < 0) if (len < 0)
return -EINVAL; return -EINVAL;
...@@ -1107,7 +1107,7 @@ static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb) ...@@ -1107,7 +1107,7 @@ static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb)
uctx->ctx_alg = s->ctx_alg; uctx->ctx_alg = s->ctx_alg;
uctx->ctx_len = s->ctx_len; uctx->ctx_len = s->ctx_len;
memcpy(uctx + 1, s->ctx_str, s->ctx_len); memcpy(uctx + 1, s->ctx_str, s->ctx_len);
return 0; return 0;
rtattr_failure: rtattr_failure:
return -1; return -1;
...@@ -2467,7 +2467,7 @@ static int __init xfrm_user_init(void) ...@@ -2467,7 +2467,7 @@ static int __init xfrm_user_init(void)
printk(KERN_INFO "Initializing XFRM netlink socket\n"); printk(KERN_INFO "Initializing XFRM netlink socket\n");
nlsk = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX, nlsk = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
xfrm_netlink_rcv, THIS_MODULE); xfrm_netlink_rcv, THIS_MODULE);
if (nlsk == NULL) if (nlsk == NULL)
return -ENOMEM; return -ENOMEM;
rcu_assign_pointer(xfrm_nl, nlsk); rcu_assign_pointer(xfrm_nl, nlsk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册