Commit 981c0ff6 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[NET] IPX: Fix whitespace errors.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ab1457c
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* work I am currently employed to do there. * work I am currently employed to do there.
* *
* All the material in this file is subject to the Gnu license version 2. * All the material in this file is subject to the Gnu license version 2.
* Neither Alan Cox nor the Swansea University Computer Society admit * Neither Alan Cox nor the Swansea University Computer Society admit
* liability nor provide warranty for any of this software. This material * liability nor provide warranty for any of this software. This material
* is provided as is and at no charge. * is provided as is and at no charge.
* *
...@@ -152,8 +152,8 @@ static void ipx_destroy_socket(struct sock *sk) ...@@ -152,8 +152,8 @@ static void ipx_destroy_socket(struct sock *sk)
ipx_remove_socket(sk); ipx_remove_socket(sk);
skb_queue_purge(&sk->sk_receive_queue); skb_queue_purge(&sk->sk_receive_queue);
#ifdef IPX_REFCNT_DEBUG #ifdef IPX_REFCNT_DEBUG
atomic_dec(&ipx_sock_nr); atomic_dec(&ipx_sock_nr);
printk(KERN_DEBUG "IPX socket %p released, %d are still alive\n", sk, printk(KERN_DEBUG "IPX socket %p released, %d are still alive\n", sk,
atomic_read(&ipx_sock_nr)); atomic_read(&ipx_sock_nr));
if (atomic_read(&sk->sk_refcnt) != 1) if (atomic_read(&sk->sk_refcnt) != 1)
printk(KERN_DEBUG "Destruction sock ipx %p delayed, cnt=%d\n", printk(KERN_DEBUG "Destruction sock ipx %p delayed, cnt=%d\n",
...@@ -162,7 +162,7 @@ static void ipx_destroy_socket(struct sock *sk) ...@@ -162,7 +162,7 @@ static void ipx_destroy_socket(struct sock *sk)
sock_put(sk); sock_put(sk);
} }
/* /*
* The following code is used to support IPX Interfaces (IPXITF). An * The following code is used to support IPX Interfaces (IPXITF). An
* IPX interface is defined by a physical device and a frame type. * IPX interface is defined by a physical device and a frame type.
*/ */
...@@ -369,7 +369,7 @@ static __exit void ipxitf_cleanup(void) ...@@ -369,7 +369,7 @@ static __exit void ipxitf_cleanup(void)
struct ipx_interface *i, *tmp; struct ipx_interface *i, *tmp;
spin_lock_bh(&ipx_interfaces_lock); spin_lock_bh(&ipx_interfaces_lock);
list_for_each_entry_safe(i, tmp, &ipx_interfaces, node) list_for_each_entry_safe(i, tmp, &ipx_interfaces, node)
__ipxitf_put(i); __ipxitf_put(i);
spin_unlock_bh(&ipx_interfaces_lock); spin_unlock_bh(&ipx_interfaces_lock);
} }
...@@ -446,10 +446,10 @@ static struct sock *ncp_connection_hack(struct ipx_interface *intrfc, ...@@ -446,10 +446,10 @@ static struct sock *ncp_connection_hack(struct ipx_interface *intrfc,
* You might call this a hack, but believe me, you do not want a * You might call this a hack, but believe me, you do not want a
* complete NCP layer in the kernel, and this is VERY fast as well. */ * complete NCP layer in the kernel, and this is VERY fast as well. */
struct sock *sk = NULL; struct sock *sk = NULL;
int connection = 0; int connection = 0;
u8 *ncphdr = (u8 *)(ipx + 1); u8 *ncphdr = (u8 *)(ipx + 1);
if (*ncphdr == 0x22 && *(ncphdr + 1) == 0x22) /* NCP request */ if (*ncphdr == 0x22 && *(ncphdr + 1) == 0x22) /* NCP request */
connection = (((int) *(ncphdr + 5)) << 8) | (int) *(ncphdr + 3); connection = (((int) *(ncphdr + 5)) << 8) | (int) *(ncphdr + 3);
else if (*ncphdr == 0x77 && *(ncphdr + 1) == 0x77) /* BURST packet */ else if (*ncphdr == 0x77 && *(ncphdr + 1) == 0x77) /* BURST packet */
connection = (((int) *(ncphdr + 9)) << 8) | (int) *(ncphdr + 8); connection = (((int) *(ncphdr + 9)) << 8) | (int) *(ncphdr + 8);
...@@ -482,7 +482,7 @@ static int ipxitf_demux_socket(struct ipx_interface *intrfc, ...@@ -482,7 +482,7 @@ static int ipxitf_demux_socket(struct ipx_interface *intrfc,
if (intrfc == ipx_primary_net && ntohs(ipx->ipx_dest.sock) == 0x451) if (intrfc == ipx_primary_net && ntohs(ipx->ipx_dest.sock) == 0x451)
sock1 = ncp_connection_hack(intrfc, ipx); sock1 = ncp_connection_hack(intrfc, ipx);
if (!sock1) if (!sock1)
/* No special socket found, forward the packet the normal way */ /* No special socket found, forward the packet the normal way */
sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock); sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock);
...@@ -607,22 +607,22 @@ int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node) ...@@ -607,22 +607,22 @@ int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node)
*last_hop = IPX_SKB_CB(skb)->last_hop.netnum; *last_hop = IPX_SKB_CB(skb)->last_hop.netnum;
IPX_SKB_CB(skb)->last_hop.index = -1; IPX_SKB_CB(skb)->last_hop.index = -1;
} }
/* /*
* We need to know how many skbuffs it will take to send out this * We need to know how many skbuffs it will take to send out this
* packet to avoid unnecessary copies. * packet to avoid unnecessary copies.
*/ */
if (!dl || !dev || dev->flags & IFF_LOOPBACK) if (!dl || !dev || dev->flags & IFF_LOOPBACK)
send_to_wire = 0; /* No non looped */ send_to_wire = 0; /* No non looped */
/* /*
* See if this should be demuxed to sockets on this interface * See if this should be demuxed to sockets on this interface
* *
* We want to ensure the original was eaten or that we only use * We want to ensure the original was eaten or that we only use
* up clones. * up clones.
*/ */
if (ipx->ipx_dest.net == intrfc->if_netnum) { if (ipx->ipx_dest.net == intrfc->if_netnum) {
/* /*
* To our own node, loop and free the original. * To our own node, loop and free the original.
...@@ -709,8 +709,8 @@ static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb) ...@@ -709,8 +709,8 @@ static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb)
/* See if we should update our network number */ /* See if we should update our network number */
if (!intrfc->if_netnum) /* net number of intrfc not known yet */ if (!intrfc->if_netnum) /* net number of intrfc not known yet */
ipxitf_discover_netnum(intrfc, skb); ipxitf_discover_netnum(intrfc, skb);
IPX_SKB_CB(skb)->last_hop.index = -1; IPX_SKB_CB(skb)->last_hop.index = -1;
if (ipx->ipx_type == IPX_TYPE_PPROP) { if (ipx->ipx_type == IPX_TYPE_PPROP) {
rc = ipxitf_pprop(intrfc, skb); rc = ipxitf_pprop(intrfc, skb);
...@@ -756,7 +756,7 @@ static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb) ...@@ -756,7 +756,7 @@ static int ipxitf_rcv(struct ipx_interface *intrfc, struct sk_buff *skb)
static void ipxitf_discover_netnum(struct ipx_interface *intrfc, static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
struct sk_buff *skb) struct sk_buff *skb)
{ {
const struct ipx_cb *cb = IPX_SKB_CB(skb); const struct ipx_cb *cb = IPX_SKB_CB(skb);
/* see if this is an intra packet: source_net == dest_net */ /* see if this is an intra packet: source_net == dest_net */
...@@ -793,7 +793,7 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc, ...@@ -793,7 +793,7 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
* it, not even processing it locally, if it has exact %IPX_MAX_PPROP_HOPS we * it, not even processing it locally, if it has exact %IPX_MAX_PPROP_HOPS we
* don't broadcast it, but process it locally. See chapter 5 of Novell's "IPX * don't broadcast it, but process it locally. See chapter 5 of Novell's "IPX
* RIP and SAP Router Specification", Part Number 107-000029-001. * RIP and SAP Router Specification", Part Number 107-000029-001.
* *
* If it is valid, check if we have pprop broadcasting enabled by the user, * If it is valid, check if we have pprop broadcasting enabled by the user,
* if not, just return zero for local processing. * if not, just return zero for local processing.
* *
...@@ -820,7 +820,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb) ...@@ -820,7 +820,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
* tctrl <= 15, any data payload... */ * tctrl <= 15, any data payload... */
if (IPX_SKB_CB(skb)->ipx_tctrl > IPX_MAX_PPROP_HOPS || if (IPX_SKB_CB(skb)->ipx_tctrl > IPX_MAX_PPROP_HOPS ||
ntohs(ipx->ipx_pktsize) < sizeof(struct ipxhdr) + ntohs(ipx->ipx_pktsize) < sizeof(struct ipxhdr) +
IPX_MAX_PPROP_HOPS * sizeof(u32)) IPX_MAX_PPROP_HOPS * sizeof(u32))
goto out; goto out;
/* are we broadcasting this damn thing? */ /* are we broadcasting this damn thing? */
rc = 0; rc = 0;
...@@ -831,7 +831,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb) ...@@ -831,7 +831,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
* locally. */ * locally. */
if (IPX_SKB_CB(skb)->ipx_tctrl == IPX_MAX_PPROP_HOPS) if (IPX_SKB_CB(skb)->ipx_tctrl == IPX_MAX_PPROP_HOPS)
goto out; goto out;
c = ((u8 *) ipx) + sizeof(struct ipxhdr); c = ((u8 *) ipx) + sizeof(struct ipxhdr);
l = (__be32 *) c; l = (__be32 *) c;
...@@ -851,7 +851,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb) ...@@ -851,7 +851,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
/* Except unconfigured interfaces */ /* Except unconfigured interfaces */
if (!ifcs->if_netnum) if (!ifcs->if_netnum)
continue; continue;
/* That aren't in the list */ /* That aren't in the list */
if (ifcs == intrfc) if (ifcs == intrfc)
continue; continue;
...@@ -1003,7 +1003,7 @@ static int ipxitf_create(struct ipx_interface_definition *idef) ...@@ -1003,7 +1003,7 @@ static int ipxitf_create(struct ipx_interface_definition *idef)
dlink_type = htons(ETH_P_IPX); dlink_type = htons(ETH_P_IPX);
datalink = pEII_datalink; datalink = pEII_datalink;
break; break;
} else } else
printk(KERN_WARNING "IPX frame type EtherII over " printk(KERN_WARNING "IPX frame type EtherII over "
"token-ring is obsolete. Use SNAP " "token-ring is obsolete. Use SNAP "
"instead.\n"); "instead.\n");
...@@ -1208,14 +1208,14 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg) ...@@ -1208,14 +1208,14 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
rc = 0; rc = 0;
break; break;
} }
case SIOCAIPXITFCRT: case SIOCAIPXITFCRT:
rc = -EFAULT; rc = -EFAULT;
if (get_user(val, (unsigned char __user *) arg)) if (get_user(val, (unsigned char __user *) arg))
break; break;
rc = 0; rc = 0;
ipxcfg_auto_create_interfaces = val; ipxcfg_auto_create_interfaces = val;
break; break;
case SIOCAIPXPRISLT: case SIOCAIPXPRISLT:
rc = -EFAULT; rc = -EFAULT;
if (get_user(val, (unsigned char __user *) arg)) if (get_user(val, (unsigned char __user *) arg))
break; break;
...@@ -1230,14 +1230,14 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg) ...@@ -1230,14 +1230,14 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
/* /*
* Checksum routine for IPX * Checksum routine for IPX
*/ */
/* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */ /* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
/* This functions should *not* mess with packet contents */ /* This functions should *not* mess with packet contents */
__be16 ipx_cksum(struct ipxhdr *packet, int length) __be16 ipx_cksum(struct ipxhdr *packet, int length)
{ {
/* /*
* NOTE: sum is a net byte order quantity, which optimizes the * NOTE: sum is a net byte order quantity, which optimizes the
* loop. This only works on big and little endian machines. (I * loop. This only works on big and little endian machines. (I
* don't know of a machine that isn't.) * don't know of a machine that isn't.)
*/ */
...@@ -1342,7 +1342,7 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname, ...@@ -1342,7 +1342,7 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
rc = -EINVAL; rc = -EINVAL;
if(len < 0) if(len < 0)
goto out; goto out;
rc = -EFAULT; rc = -EFAULT;
if (put_user(len, optlen) || copy_to_user(optval, &val, len)) if (put_user(len, optlen) || copy_to_user(optval, &val, len))
goto out; goto out;
...@@ -1372,13 +1372,13 @@ static int ipx_create(struct socket *sock, int protocol) ...@@ -1372,13 +1372,13 @@ static int ipx_create(struct socket *sock, int protocol)
if (sock->type != SOCK_DGRAM) if (sock->type != SOCK_DGRAM)
goto out; goto out;
rc = -ENOMEM; rc = -ENOMEM;
sk = sk_alloc(PF_IPX, GFP_KERNEL, &ipx_proto, 1); sk = sk_alloc(PF_IPX, GFP_KERNEL, &ipx_proto, 1);
if (!sk) if (!sk)
goto out; goto out;
#ifdef IPX_REFCNT_DEBUG #ifdef IPX_REFCNT_DEBUG
atomic_inc(&ipx_sock_nr); atomic_inc(&ipx_sock_nr);
printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk, printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk,
atomic_read(&ipx_sock_nr)); atomic_read(&ipx_sock_nr));
#endif #endif
sock_init_data(sock, sk); sock_init_data(sock, sk);
...@@ -1561,7 +1561,7 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr, ...@@ -1561,7 +1561,7 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
goto out; goto out;
} }
/* We can either connect to primary network or somewhere /* We can either connect to primary network or somewhere
* we can route to */ * we can route to */
rt = ipxrtr_lookup(addr->sipx_network); rt = ipxrtr_lookup(addr->sipx_network);
rc = -ENETUNREACH; rc = -ENETUNREACH;
...@@ -1641,10 +1641,10 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty ...@@ -1641,10 +1641,10 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
struct ipxhdr *ipx; struct ipxhdr *ipx;
u16 ipx_pktsize; u16 ipx_pktsize;
int rc = 0; int rc = 0;
/* Not ours */ /* Not ours */
if (skb->pkt_type == PACKET_OTHERHOST) if (skb->pkt_type == PACKET_OTHERHOST)
goto drop; goto drop;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
goto out; goto out;
...@@ -1653,12 +1653,12 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty ...@@ -1653,12 +1653,12 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
goto drop; goto drop;
ipx_pktsize = ntohs(ipx_hdr(skb)->ipx_pktsize); ipx_pktsize = ntohs(ipx_hdr(skb)->ipx_pktsize);
/* Too small or invalid header? */ /* Too small or invalid header? */
if (ipx_pktsize < sizeof(struct ipxhdr) || if (ipx_pktsize < sizeof(struct ipxhdr) ||
!pskb_may_pull(skb, ipx_pktsize)) !pskb_may_pull(skb, ipx_pktsize))
goto drop; goto drop;
ipx = ipx_hdr(skb); ipx = ipx_hdr(skb);
if (ipx->ipx_checksum != IPX_NO_CHECKSUM && if (ipx->ipx_checksum != IPX_NO_CHECKSUM &&
ipx->ipx_checksum != ipx_cksum(ipx, ipx_pktsize)) ipx->ipx_checksum != ipx_cksum(ipx, ipx_pktsize))
...@@ -1786,7 +1786,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1786,7 +1786,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
if (rc) if (rc)
goto out; goto out;
} }
rc = -ENOTCONN; rc = -ENOTCONN;
if (sock_flag(sk, SOCK_ZAPPED)) if (sock_flag(sk, SOCK_ZAPPED))
goto out; goto out;
...@@ -1875,15 +1875,15 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1875,15 +1875,15 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
* This socket wants to take care of the NCP connection * This socket wants to take care of the NCP connection
* handed to us in arg. * handed to us in arg.
*/ */
rc = -EPERM; rc = -EPERM;
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
break; break;
rc = get_user(ipx_sk(sk)->ipx_ncp_conn, rc = get_user(ipx_sk(sk)->ipx_ncp_conn,
(const unsigned short __user *)argp); (const unsigned short __user *)argp);
break; break;
case SIOCGSTAMP: case SIOCGSTAMP:
rc = -EINVAL; rc = -EINVAL;
if (sk) if (sk)
rc = sock_get_timestamp(sk, argp); rc = sock_get_timestamp(sk, argp);
break; break;
case SIOCGIFDSTADDR: case SIOCGIFDSTADDR:
......
...@@ -352,7 +352,7 @@ int __init ipx_proc_init(void) ...@@ -352,7 +352,7 @@ int __init ipx_proc_init(void)
{ {
struct proc_dir_entry *p; struct proc_dir_entry *p;
int rc = -ENOMEM; int rc = -ENOMEM;
ipx_proc_dir = proc_mkdir("ipx", proc_net); ipx_proc_dir = proc_mkdir("ipx", proc_net);
if (!ipx_proc_dir) if (!ipx_proc_dir)
......
...@@ -234,7 +234,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx, ...@@ -234,7 +234,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
if (rc) { if (rc) {
kfree_skb(skb); kfree_skb(skb);
goto out_put; goto out_put;
} }
/* Apply checksum. Not allowed on 802.3 links. */ /* Apply checksum. Not allowed on 802.3 links. */
if (sk->sk_no_check || intrfc->if_dlink_type == htons(IPX_FRAME_8023)) if (sk->sk_no_check || intrfc->if_dlink_type == htons(IPX_FRAME_8023))
...@@ -242,7 +242,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx, ...@@ -242,7 +242,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
else else
ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr)); ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr));
rc = ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ? rc = ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ?
rt->ir_router_node : ipx->ipx_dest.node); rt->ir_router_node : ipx->ipx_dest.node);
out_put: out_put:
ipxitf_put(intrfc); ipxitf_put(intrfc);
......
...@@ -34,7 +34,7 @@ static struct ctl_table ipx_dir_table[] = { ...@@ -34,7 +34,7 @@ static struct ctl_table ipx_dir_table[] = {
.procname = "ipx", .procname = "ipx",
.mode = 0555, .mode = 0555,
.child = ipx_table, .child = ipx_table,
}, },
{ 0 }, { 0 },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment