Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
  [IPSEC] flow: reorder "struct flow_cache_entry" and remove SLAB_HWCACHE_ALIGN
  [DECNET] ROUTE: remove unecessary alignment
  [IPSEC]: Add support for aes-ctr.
  [ISDN]: fix section mismatch warning in enpci_card_msg
  [TIPC]: declare proto_ops structures as 'const'.
  [TIPC]: Kill unused static inline (x5)
  [TC]: oops in em_meta
  [IPV6] Minor cleanup: remove unused definitions in net/ip6_fib.h
  [IPV6] Minor clenup: remove two unused definitions in net/ip6_route.h
  [AF_IUCV]: defensive programming of iucv_callback_txdone
  [AF_IUCV]: broken send_skb_q results in endless loop
  [IUCV]: wrong irq-disabling locking at module load time
  [CAN]: Minor clean-ups
  [CAN]: Move proto_{,un}register() out of spin-locked region
  [CAN]: Clean up module auto loading
  [IPSEC] flow: Remove an unnecessary ____cacheline_aligned
  [IPV4]: route: fix crash ip_route_input
  [NETFILTER]: xt_iprange: add missing #include
  [NETFILTER]: xt_iprange: fix typo in address family
  [NETFILTER]: nf_conntrack: fix ct_extend ->move operation
  ...
  • Loading branch information
Linus Torvalds committed Feb 8, 2008
2 parents 7b791d4 + dd5a184 commit 3668805
Show file tree
Hide file tree
Showing 23 changed files with 122 additions and 133 deletions.
3 changes: 1 addition & 2 deletions drivers/isdn/hisax/amd7930_fn.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,7 @@ dbusy_timer_handler(struct IsdnCardState *cs)



void __devinit
Amd7930_init(struct IsdnCardState *cs)
void Amd7930_init(struct IsdnCardState *cs)
{
WORD *ptr;
BYTE cmd, cnt;
Expand Down
1 change: 1 addition & 0 deletions include/linux/pfkeyv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ struct sadb_x_sec_ctx {
#define SADB_X_EALG_BLOWFISHCBC 7
#define SADB_EALG_NULL 11
#define SADB_X_EALG_AESCBC 12
#define SADB_X_EALG_AESCTR 13
#define SADB_X_EALG_AES_CCM_ICV8 14
#define SADB_X_EALG_AES_CCM_ICV12 15
#define SADB_X_EALG_AES_CCM_ICV16 16
Expand Down
13 changes: 0 additions & 13 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,6 @@ struct rt6_statistics {
*
*/

#define RTPRI_FIREWALL 8 /* Firewall control information */
#define RTPRI_FLOW 16 /* Flow based forwarding rules */
#define RTPRI_KERN_CTL 32 /* Kernel control routes */

#define RTPRI_USER_MIN 256 /* Mimimum user priority */
#define RTPRI_USER_MAX 1024 /* Maximum user priority */

#define RTPRI_KERN_DFLT 4096 /* Kernel default routes */

#define MAX_FLOW_BACKTRACE 32


typedef void (*f_pnode)(struct fib6_node *fn, void *);

struct fib6_table {
struct hlist_node tb6_hlist;
Expand Down
2 changes: 0 additions & 2 deletions include/net/ip6_route.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#ifndef _NET_IP6_ROUTE_H
#define _NET_IP6_ROUTE_H

#define IP6_RT_PRIO_FW 16
#define IP6_RT_PRIO_USER 1024
#define IP6_RT_PRIO_ADDRCONF 256
#define IP6_RT_PRIO_KERN 512
#define IP6_RT_FLOW_MASK 0x00ff

struct route_info {
__u8 type;
Expand Down
2 changes: 1 addition & 1 deletion include/net/netfilter/nf_conntrack_extend.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct nf_ct_ext_type
void (*destroy)(struct nf_conn *ct);
/* Called when realloacted (can be NULL).
Contents has already been moved. */
void (*move)(struct nf_conn *ct, void *old);
void (*move)(void *new, void *old);

enum nf_ct_ext_id id;

Expand Down
16 changes: 0 additions & 16 deletions include/net/tipc/tipc_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ static inline u32 msg_type(struct tipc_msg *m)
return msg_bits(m, 1, 29, 0x7);
}

static inline u32 msg_direct(struct tipc_msg *m)
{
return (msg_type(m) == TIPC_DIRECT_MSG);
}

static inline u32 msg_named(struct tipc_msg *m)
{
return (msg_type(m) == TIPC_NAMED_MSG);
Expand Down Expand Up @@ -207,17 +202,6 @@ static inline u32 msg_nameupper(struct tipc_msg *m)
return msg_word(m, 10);
}

static inline char *msg_options(struct tipc_msg *m, u32 *len)
{
u32 pos = msg_bits(m, 1, 16, 0x7);

if (!pos)
return 0;
pos = (pos * 4) + 28;
*len = msg_hdr_sz(m) - pos;
return (char *)&m->hdr[pos/4];
}

#endif

#endif
45 changes: 20 additions & 25 deletions net/can/af_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
{
struct sock *sk;
struct can_proto *cp;
char module_name[sizeof("can-proto-000")];
int err = 0;

sock->state = SS_UNCONNECTED;
Expand All @@ -129,26 +128,21 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
if (net != &init_net)
return -EAFNOSUPPORT;

#ifdef CONFIG_KMOD
/* try to load protocol module, when CONFIG_KMOD is defined */
if (!proto_tab[protocol]) {
sprintf(module_name, "can-proto-%d", protocol);
err = request_module(module_name);
err = request_module("can-proto-%d", protocol);

/*
* In case of error we only print a message but don't
* return the error code immediately. Below we will
* return -EPROTONOSUPPORT
*/
if (err == -ENOSYS) {
if (printk_ratelimit())
printk(KERN_INFO "can: request_module(%s)"
" not implemented.\n", module_name);
} else if (err) {
if (printk_ratelimit())
printk(KERN_ERR "can: request_module(%s)"
" failed.\n", module_name);
}
if (err && printk_ratelimit())
printk(KERN_ERR "can: request_module "
"(can-proto-%d) failed.\n", protocol);
}
#endif

spin_lock(&proto_tab_lock);
cp = proto_tab[protocol];
Expand Down Expand Up @@ -662,26 +656,26 @@ int can_proto_register(struct can_proto *cp)
return -EINVAL;
}

err = proto_register(cp->prot, 0);
if (err < 0)
return err;

spin_lock(&proto_tab_lock);
if (proto_tab[proto]) {
printk(KERN_ERR "can: protocol %d already registered\n",
proto);
err = -EBUSY;
goto errout;
} else {
proto_tab[proto] = cp;

/* use generic ioctl function if not defined by module */
if (!cp->ops->ioctl)
cp->ops->ioctl = can_ioctl;
}
spin_unlock(&proto_tab_lock);

err = proto_register(cp->prot, 0);
if (err < 0)
goto errout;

proto_tab[proto] = cp;

/* use generic ioctl function if the module doesn't bring its own */
if (!cp->ops->ioctl)
cp->ops->ioctl = can_ioctl;

errout:
spin_unlock(&proto_tab_lock);
proto_unregister(cp->prot);

return err;
}
Expand All @@ -700,9 +694,10 @@ void can_proto_unregister(struct can_proto *cp)
printk(KERN_ERR "BUG: can: protocol %d is not registered\n",
proto);
}
proto_unregister(cp->prot);
proto_tab[proto] = NULL;
spin_unlock(&proto_tab_lock);

proto_unregister(cp->prot);
}
EXPORT_SYMBOL(can_proto_unregister);

Expand Down
24 changes: 9 additions & 15 deletions net/can/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ static void raw_rcv(struct sk_buff *skb, void *data)
struct sock *sk = (struct sock *)data;
struct raw_sock *ro = raw_sk(sk);
struct sockaddr_can *addr;
int error;

if (!ro->recv_own_msgs) {
/* check the received tx sock reference */
Expand All @@ -121,14 +120,12 @@ static void raw_rcv(struct sk_buff *skb, void *data)
addr->can_family = AF_CAN;
addr->can_ifindex = skb->dev->ifindex;

error = sock_queue_rcv_skb(sk, skb);
if (error < 0)
if (sock_queue_rcv_skb(sk, skb) < 0)
kfree_skb(skb);
}

static int raw_enable_filters(struct net_device *dev, struct sock *sk,
struct can_filter *filter,
int count)
struct can_filter *filter, int count)
{
int err = 0;
int i;
Expand Down Expand Up @@ -163,8 +160,7 @@ static int raw_enable_errfilter(struct net_device *dev, struct sock *sk,
}

static void raw_disable_filters(struct net_device *dev, struct sock *sk,
struct can_filter *filter,
int count)
struct can_filter *filter, int count)
{
int i;

Expand Down Expand Up @@ -353,7 +349,6 @@ static int raw_bind(struct socket *sock, struct sockaddr *uaddr, int len)
/* filters set by default/setsockopt */
err = raw_enable_allfilters(dev, sk);
dev_put(dev);

} else {
ifindex = 0;

Expand Down Expand Up @@ -466,7 +461,6 @@ static int raw_setsockopt(struct socket *sock, int level, int optname,
if (err) {
if (count > 1)
kfree(filter);

goto out_fil;
}

Expand Down Expand Up @@ -673,25 +667,25 @@ static int raw_recvmsg(struct kiocb *iocb, struct socket *sock,
{
struct sock *sk = sock->sk;
struct sk_buff *skb;
int error = 0;
int err = 0;
int noblock;

noblock = flags & MSG_DONTWAIT;
flags &= ~MSG_DONTWAIT;

skb = skb_recv_datagram(sk, flags, noblock, &error);
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
return error;
return err;

if (size < skb->len)
msg->msg_flags |= MSG_TRUNC;
else
size = skb->len;

error = memcpy_toiovec(msg->msg_iov, skb->data, size);
if (error < 0) {
err = memcpy_toiovec(msg->msg_iov, skb->data, size);
if (err < 0) {
skb_free_datagram(sk, skb);
return error;
return err;
}

sock_recv_timestamp(msg, sk, skb);
Expand Down
6 changes: 3 additions & 3 deletions net/core/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct flow_cache_entry {
struct flow_cache_entry *next;
u16 family;
u8 dir;
struct flowi key;
u32 genid;
struct flowi key;
void *object;
atomic_t *object_ref;
};
Expand All @@ -52,7 +52,7 @@ struct flow_percpu_info {
int hash_rnd_recalc;
u32 hash_rnd;
int count;
} ____cacheline_aligned;
};
static DEFINE_PER_CPU(struct flow_percpu_info, flow_hash_info) = { 0 };

#define flow_hash_rnd_recalc(cpu) \
Expand Down Expand Up @@ -346,7 +346,7 @@ static int __init flow_cache_init(void)

flow_cachep = kmem_cache_create("flow_cache",
sizeof(struct flow_cache_entry),
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
0, SLAB_PANIC,
NULL);
flow_hash_shift = 10;
flow_lwm = 2 * flow_hash_size;
Expand Down
2 changes: 1 addition & 1 deletion net/decnet/dn_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct dn_rt_hash_bucket
{
struct dn_route *chain;
spinlock_t lock;
} __attribute__((__aligned__(8)));
};

extern struct neigh_table dn_neigh_table;

Expand Down
6 changes: 3 additions & 3 deletions net/ipv4/netfilter/nf_nat_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ static void nf_nat_cleanup_conntrack(struct nf_conn *ct)
spin_unlock_bh(&nf_nat_lock);
}

static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
static void nf_nat_move_storage(void *new, void *old)
{
struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
struct nf_conn_nat *new_nat = new;
struct nf_conn_nat *old_nat = old;
struct nf_conn *ct = old_nat->ct;

if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
int iif = dev->ifindex;
struct net *net;

net = skb->dev->nd_net;
net = dev->nd_net;
tos &= IPTOS_RT_MASK;
hash = rt_hash(daddr, saddr, iif);

Expand Down
27 changes: 20 additions & 7 deletions net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ static int iucv_sock_connect(struct socket *sock, struct sockaddr *addr,
/* Create path. */
iucv->path = iucv_path_alloc(IUCV_QUEUELEN_DEFAULT,
IPRMDATA, GFP_KERNEL);
if (!iucv->path) {
err = -ENOMEM;
goto done;
}
err = iucv_path_connect(iucv->path, &af_iucv_handler,
sa->siucv_user_id, NULL, user_data, sk);
if (err) {
Expand Down Expand Up @@ -1094,6 +1098,8 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)

save_message:
save_msg = kzalloc(sizeof(struct sock_msg_q), GFP_ATOMIC | GFP_DMA);
if (!save_msg)
return;
save_msg->path = path;
save_msg->msg = *msg;

Expand All @@ -1106,24 +1112,31 @@ static void iucv_callback_txdone(struct iucv_path *path,
struct iucv_message *msg)
{
struct sock *sk = path->private;
struct sk_buff *this;
struct sk_buff *this = NULL;
struct sk_buff_head *list = &iucv_sk(sk)->send_skb_q;
struct sk_buff *list_skb = list->next;
unsigned long flags;

if (list_skb) {
if (!skb_queue_empty(list)) {
spin_lock_irqsave(&list->lock, flags);

do {
this = list_skb;
while (list_skb != (struct sk_buff *)list) {
if (!memcmp(&msg->tag, list_skb->cb, 4)) {
this = list_skb;
break;
}
list_skb = list_skb->next;
} while (memcmp(&msg->tag, this->cb, 4) && list_skb);
}
if (this)
__skb_unlink(this, list);

spin_unlock_irqrestore(&list->lock, flags);

skb_unlink(this, &iucv_sk(sk)->send_skb_q);
kfree_skb(this);
if (this)
kfree_skb(this);
}
if (!this)
printk(KERN_ERR "AF_IUCV msg tag %u not found\n", msg->tag);

if (sk->sk_state == IUCV_CLOSING) {
if (skb_queue_empty(&iucv_sk(sk)->send_skb_q)) {
Expand Down
4 changes: 2 additions & 2 deletions net/iucv/iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,9 @@ int iucv_register(struct iucv_handler *handler, int smp)
iucv_setmask_up();
INIT_LIST_HEAD(&handler->paths);

spin_lock_irq(&iucv_table_lock);
spin_lock_bh(&iucv_table_lock);
list_add_tail(&handler->list, &iucv_handler_list);
spin_unlock_irq(&iucv_table_lock);
spin_unlock_bh(&iucv_table_lock);
rc = 0;
out_mutex:
mutex_unlock(&iucv_register_mutex);
Expand Down
Loading

0 comments on commit 3668805

Please sign in to comment.