mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[DECnet]: Endian annotation and fixes for DECnet.
The typedef for dn_address has been removed in favour of using __le16 or __u16 directly as appropriate. All the DECnet header files are updated accordingly. The byte ordering of dn_eth2dn() and dn_dn2eth() are both changed since just about all their callers wanted network order rather than host order, so the conversion is now done in the functions themselves. Several missed endianess conversions have been picked up during the conversion process. The nh_gw field in struct dn_fib_info has been changed from a 32 bit field to 16 bits as it ought to be. One or two cases of using htons rather than dn_htons in the routing code have been found and fixed. There are still a few warnings to fix, but this patch deals with the important cases. Signed-off-by: Steven Whitehouse <steve@chygwyn.com> Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2c7946a7bf
commit
c4ea94ab37
18 changed files with 300 additions and 298 deletions
|
@ -86,9 +86,9 @@ static void strip_it(char *str)
|
|||
* Simple routine to parse an ascii DECnet address
|
||||
* into a network order address.
|
||||
*/
|
||||
static int parse_addr(dn_address *addr, char *str)
|
||||
static int parse_addr(__le16 *addr, char *str)
|
||||
{
|
||||
dn_address area, node;
|
||||
__u16 area, node;
|
||||
|
||||
while(*str && !ISNUM(*str)) str++;
|
||||
|
||||
|
@ -139,7 +139,7 @@ static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen
|
|||
void **context)
|
||||
{
|
||||
size_t len;
|
||||
dn_address addr;
|
||||
__le16 addr;
|
||||
|
||||
if (oldval && oldlenp) {
|
||||
if (get_user(len, oldlenp))
|
||||
|
@ -147,14 +147,14 @@ static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen
|
|||
if (len) {
|
||||
if (len != sizeof(unsigned short))
|
||||
return -EINVAL;
|
||||
if (put_user(decnet_address, (unsigned short __user *)oldval))
|
||||
if (put_user(decnet_address, (__le16 __user *)oldval))
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
if (newval && newlen) {
|
||||
if (newlen != sizeof(unsigned short))
|
||||
return -EINVAL;
|
||||
if (get_user(addr, (unsigned short __user *)newval))
|
||||
if (get_user(addr, (__le16 __user *)newval))
|
||||
return -EFAULT;
|
||||
|
||||
dn_dev_devices_off();
|
||||
|
@ -173,7 +173,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
|
|||
{
|
||||
char addr[DN_ASCBUF_LEN];
|
||||
size_t len;
|
||||
dn_address dnaddr;
|
||||
__le16 dnaddr;
|
||||
|
||||
if (!*lenp || (*ppos && !write)) {
|
||||
*lenp = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue