[NET] APPLETALK: Fix whitespace errors.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
122952fc2d
commit
ed4477b960
@@ -100,17 +100,17 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to,
|
|||||||
if (to->sat_port != at->src_port)
|
if (to->sat_port != at->src_port)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (to->sat_addr.s_net == ATADDR_ANYNET &&
|
if (to->sat_addr.s_net == ATADDR_ANYNET &&
|
||||||
to->sat_addr.s_node == ATADDR_BCAST)
|
to->sat_addr.s_node == ATADDR_BCAST)
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
if (to->sat_addr.s_net == at->src_net &&
|
if (to->sat_addr.s_net == at->src_net &&
|
||||||
(to->sat_addr.s_node == at->src_node ||
|
(to->sat_addr.s_node == at->src_node ||
|
||||||
to->sat_addr.s_node == ATADDR_BCAST ||
|
to->sat_addr.s_node == ATADDR_BCAST ||
|
||||||
to->sat_addr.s_node == ATADDR_ANYNODE))
|
to->sat_addr.s_node == ATADDR_ANYNODE))
|
||||||
goto found;
|
goto found;
|
||||||
|
|
||||||
/* XXXX.0 -- we got a request for this router. make sure
|
/* XXXX.0 -- we got a request for this router. make sure
|
||||||
* that the node is appropriately set. */
|
* that the node is appropriately set. */
|
||||||
if (to->sat_addr.s_node == ATADDR_ANYNODE &&
|
if (to->sat_addr.s_node == ATADDR_ANYNODE &&
|
||||||
to->sat_addr.s_net != ATADDR_ANYNET &&
|
to->sat_addr.s_net != ATADDR_ANYNET &&
|
||||||
@@ -417,7 +417,7 @@ static struct atalk_iface *atalk_find_interface(__be16 net, int node)
|
|||||||
if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET &&
|
if (node == ATADDR_ANYNODE && net != ATADDR_ANYNET &&
|
||||||
ntohs(iface->nets.nr_firstnet) <= ntohs(net) &&
|
ntohs(iface->nets.nr_firstnet) <= ntohs(net) &&
|
||||||
ntohs(net) <= ntohs(iface->nets.nr_lastnet))
|
ntohs(net) <= ntohs(iface->nets.nr_lastnet))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
read_unlock_bh(&atalk_interfaces_lock);
|
read_unlock_bh(&atalk_interfaces_lock);
|
||||||
return iface;
|
return iface;
|
||||||
@@ -540,9 +540,9 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
|
|||||||
for (iface = atalk_interfaces; iface; iface = iface->next) {
|
for (iface = atalk_interfaces; iface; iface = iface->next) {
|
||||||
if (!riface &&
|
if (!riface &&
|
||||||
ntohs(ga->sat_addr.s_net) >=
|
ntohs(ga->sat_addr.s_net) >=
|
||||||
ntohs(iface->nets.nr_firstnet) &&
|
ntohs(iface->nets.nr_firstnet) &&
|
||||||
ntohs(ga->sat_addr.s_net) <=
|
ntohs(ga->sat_addr.s_net) <=
|
||||||
ntohs(iface->nets.nr_lastnet))
|
ntohs(iface->nets.nr_lastnet))
|
||||||
riface = iface;
|
riface = iface;
|
||||||
|
|
||||||
if (ga->sat_addr.s_net == iface->address.s_net &&
|
if (ga->sat_addr.s_net == iface->address.s_net &&
|
||||||
@@ -649,7 +649,7 @@ static int ddp_device_event(struct notifier_block *this, unsigned long event,
|
|||||||
{
|
{
|
||||||
if (event == NETDEV_DOWN)
|
if (event == NETDEV_DOWN)
|
||||||
/* Discard any use of this */
|
/* Discard any use of this */
|
||||||
atalk_dev_down(ptr);
|
atalk_dev_down(ptr);
|
||||||
|
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
@@ -701,7 +701,7 @@ static int atif_ioctl(int cmd, void __user *arg)
|
|||||||
*/
|
*/
|
||||||
if ((dev->flags & IFF_POINTOPOINT) &&
|
if ((dev->flags & IFF_POINTOPOINT) &&
|
||||||
atalk_find_interface(sa->sat_addr.s_net,
|
atalk_find_interface(sa->sat_addr.s_net,
|
||||||
sa->sat_addr.s_node)) {
|
sa->sat_addr.s_node)) {
|
||||||
printk(KERN_DEBUG "AppleTalk: point-to-point "
|
printk(KERN_DEBUG "AppleTalk: point-to-point "
|
||||||
"interface added with "
|
"interface added with "
|
||||||
"existing address\n");
|
"existing address\n");
|
||||||
@@ -797,8 +797,8 @@ static int atif_ioctl(int cmd, void __user *arg)
|
|||||||
sa->sat_addr.s_node = ATADDR_BCAST;
|
sa->sat_addr.s_node = ATADDR_BCAST;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCATALKDIFADDR:
|
case SIOCATALKDIFADDR:
|
||||||
case SIOCDIFADDR:
|
case SIOCDIFADDR:
|
||||||
if (!capable(CAP_NET_ADMIN))
|
if (!capable(CAP_NET_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
if (sa->sat_family != AF_APPLETALK)
|
if (sa->sat_family != AF_APPLETALK)
|
||||||
@@ -808,67 +808,67 @@ static int atif_ioctl(int cmd, void __user *arg)
|
|||||||
|
|
||||||
case SIOCSARP:
|
case SIOCSARP:
|
||||||
if (!capable(CAP_NET_ADMIN))
|
if (!capable(CAP_NET_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
if (sa->sat_family != AF_APPLETALK)
|
if (sa->sat_family != AF_APPLETALK)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (!atif)
|
if (!atif)
|
||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for now, we only support proxy AARP on ELAP;
|
* for now, we only support proxy AARP on ELAP;
|
||||||
* we should be able to do it for LocalTalk, too.
|
* we should be able to do it for LocalTalk, too.
|
||||||
*/
|
*/
|
||||||
if (dev->type != ARPHRD_ETHER)
|
if (dev->type != ARPHRD_ETHER)
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* atif points to the current interface on this network;
|
* atif points to the current interface on this network;
|
||||||
* we aren't concerned about its current status (at
|
* we aren't concerned about its current status (at
|
||||||
* least for now), but it has all the settings about
|
* least for now), but it has all the settings about
|
||||||
* the network we're going to probe. Consequently, it
|
* the network we're going to probe. Consequently, it
|
||||||
* must exist.
|
* must exist.
|
||||||
*/
|
*/
|
||||||
if (!atif)
|
if (!atif)
|
||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
nr = (struct atalk_netrange *)&(atif->nets);
|
nr = (struct atalk_netrange *)&(atif->nets);
|
||||||
/*
|
/*
|
||||||
* Phase 1 is fine on Localtalk but we don't do
|
* Phase 1 is fine on Localtalk but we don't do
|
||||||
* Ethertalk phase 1. Anyone wanting to add it go ahead.
|
* Ethertalk phase 1. Anyone wanting to add it go ahead.
|
||||||
*/
|
*/
|
||||||
if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2)
|
if (dev->type == ARPHRD_ETHER && nr->nr_phase != 2)
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
|
|
||||||
if (sa->sat_addr.s_node == ATADDR_BCAST ||
|
if (sa->sat_addr.s_node == ATADDR_BCAST ||
|
||||||
sa->sat_addr.s_node == 254)
|
sa->sat_addr.s_node == 254)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if the chosen address is used. If so we
|
|
||||||
* error and ATCP will try another.
|
|
||||||
*/
|
|
||||||
if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
|
|
||||||
return -EADDRINUSE;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We now have an address on the local network, and
|
* Check if the chosen address is used. If so we
|
||||||
|
* error and ATCP will try another.
|
||||||
|
*/
|
||||||
|
if (atif_proxy_probe_device(atif, &(sa->sat_addr)) < 0)
|
||||||
|
return -EADDRINUSE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We now have an address on the local network, and
|
||||||
* the AARP code will defend it for us until we take it
|
* the AARP code will defend it for us until we take it
|
||||||
* down. We don't set up any routes right now, because
|
* down. We don't set up any routes right now, because
|
||||||
* ATCP will install them manually via SIOCADDRT.
|
* ATCP will install them manually via SIOCADDRT.
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIOCDARP:
|
case SIOCDARP:
|
||||||
if (!capable(CAP_NET_ADMIN))
|
if (!capable(CAP_NET_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
if (sa->sat_family != AF_APPLETALK)
|
if (sa->sat_family != AF_APPLETALK)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (!atif)
|
if (!atif)
|
||||||
return -EADDRNOTAVAIL;
|
return -EADDRNOTAVAIL;
|
||||||
|
|
||||||
/* give to aarp module to remove proxy entry */
|
/* give to aarp module to remove proxy entry */
|
||||||
aarp_proxy_remove(atif->dev, &(sa->sat_addr));
|
aarp_proxy_remove(atif->dev, &(sa->sat_addr));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return copy_to_user(arg, &atreq, sizeof(atreq)) ? -EFAULT : 0;
|
return copy_to_user(arg, &atreq, sizeof(atreq)) ? -EFAULT : 0;
|
||||||
@@ -1260,27 +1260,27 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr,
|
|||||||
#if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE)
|
#if defined(CONFIG_IPDDP) || defined(CONFIG_IPDDP_MODULE)
|
||||||
static __inline__ int is_ip_over_ddp(struct sk_buff *skb)
|
static __inline__ int is_ip_over_ddp(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
return skb->data[12] == 22;
|
return skb->data[12] == 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_ip_over_ddp(struct sk_buff *skb)
|
static int handle_ip_over_ddp(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct net_device *dev = __dev_get_by_name("ipddp0");
|
struct net_device *dev = __dev_get_by_name("ipddp0");
|
||||||
struct net_device_stats *stats;
|
struct net_device_stats *stats;
|
||||||
|
|
||||||
/* This needs to be able to handle ipddp"N" devices */
|
/* This needs to be able to handle ipddp"N" devices */
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
skb->protocol = htons(ETH_P_IP);
|
skb->protocol = htons(ETH_P_IP);
|
||||||
skb_pull(skb, 13);
|
skb_pull(skb, 13);
|
||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
skb->h.raw = skb->data;
|
skb->h.raw = skb->data;
|
||||||
|
|
||||||
stats = dev->priv;
|
stats = dev->priv;
|
||||||
stats->rx_packets++;
|
stats->rx_packets++;
|
||||||
stats->rx_bytes += skb->len + 13;
|
stats->rx_bytes += skb->len + 13;
|
||||||
netif_rx(skb); /* Send the SKB up to a higher place. */
|
netif_rx(skb); /* Send the SKB up to a higher place. */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -1335,8 +1335,8 @@ static void atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
|
|||||||
ta.s_node = rt->gateway.s_node;
|
ta.s_node = rt->gateway.s_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fix up skb->len field */
|
/* Fix up skb->len field */
|
||||||
skb_trim(skb, min_t(unsigned int, origlen,
|
skb_trim(skb, min_t(unsigned int, origlen,
|
||||||
(rt->dev->hard_header_len +
|
(rt->dev->hard_header_len +
|
||||||
ddp_dl->header_length + (len_hops & 1023))));
|
ddp_dl->header_length + (len_hops & 1023))));
|
||||||
|
|
||||||
@@ -1395,7 +1395,7 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||||||
struct sock *sock;
|
struct sock *sock;
|
||||||
struct atalk_iface *atif;
|
struct atalk_iface *atif;
|
||||||
struct sockaddr_at tosat;
|
struct sockaddr_at tosat;
|
||||||
int origlen;
|
int origlen;
|
||||||
__u16 len_hops;
|
__u16 len_hops;
|
||||||
|
|
||||||
/* Don't mangle buffer if shared */
|
/* Don't mangle buffer if shared */
|
||||||
@@ -1501,11 +1501,11 @@ static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||||||
|
|
||||||
/* Now fill in the long header */
|
/* Now fill in the long header */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These two first. The mac overlays the new source/dest
|
* These two first. The mac overlays the new source/dest
|
||||||
* network information so we MUST copy these before
|
* network information so we MUST copy these before
|
||||||
* we write the network numbers !
|
* we write the network numbers !
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */
|
ddp->deh_dnode = skb->mac.raw[0]; /* From physical header */
|
||||||
ddp->deh_snode = skb->mac.raw[1]; /* From physical header */
|
ddp->deh_snode = skb->mac.raw[1]; /* From physical header */
|
||||||
|
Reference in New Issue
Block a user