diff options
Diffstat (limited to 'net/ax25')
| -rw-r--r-- | net/ax25/af_ax25.c | 46 | ||||
| -rw-r--r-- | net/ax25/ax25_addr.c | 27 | ||||
| -rw-r--r-- | net/ax25/ax25_ip.c | 6 |
3 files changed, 36 insertions, 43 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index ed705ddad56b..8e37e71e34ff 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
| @@ -1695,16 +1695,12 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
| 1695 | /* These two are safe on a single CPU system as only user tasks fiddle here */ | 1695 | /* These two are safe on a single CPU system as only user tasks fiddle here */ |
| 1696 | if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) | 1696 | if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) |
| 1697 | amount = skb->len; | 1697 | amount = skb->len; |
| 1698 | res = put_user(amount, (int __user *)argp); | 1698 | res = put_user(amount, (int __user *) argp); |
| 1699 | break; | 1699 | break; |
| 1700 | } | 1700 | } |
| 1701 | 1701 | ||
| 1702 | case SIOCGSTAMP: | 1702 | case SIOCGSTAMP: |
| 1703 | if (sk != NULL) { | 1703 | res = sock_get_timestamp(sk, argp); |
| 1704 | res = sock_get_timestamp(sk, argp); | ||
| 1705 | break; | ||
| 1706 | } | ||
| 1707 | res = -EINVAL; | ||
| 1708 | break; | 1704 | break; |
| 1709 | 1705 | ||
| 1710 | case SIOCAX25ADDUID: /* Add a uid to the uid/call map table */ | 1706 | case SIOCAX25ADDUID: /* Add a uid to the uid/call map table */ |
| @@ -1951,24 +1947,24 @@ static struct net_proto_family ax25_family_ops = { | |||
| 1951 | }; | 1947 | }; |
| 1952 | 1948 | ||
| 1953 | static struct proto_ops ax25_proto_ops = { | 1949 | static struct proto_ops ax25_proto_ops = { |
| 1954 | .family = PF_AX25, | 1950 | .family = PF_AX25, |
| 1955 | .owner = THIS_MODULE, | 1951 | .owner = THIS_MODULE, |
| 1956 | .release = ax25_release, | 1952 | .release = ax25_release, |
| 1957 | .bind = ax25_bind, | 1953 | .bind = ax25_bind, |
| 1958 | .connect = ax25_connect, | 1954 | .connect = ax25_connect, |
| 1959 | .socketpair = sock_no_socketpair, | 1955 | .socketpair = sock_no_socketpair, |
| 1960 | .accept = ax25_accept, | 1956 | .accept = ax25_accept, |
| 1961 | .getname = ax25_getname, | 1957 | .getname = ax25_getname, |
| 1962 | .poll = datagram_poll, | 1958 | .poll = datagram_poll, |
| 1963 | .ioctl = ax25_ioctl, | 1959 | .ioctl = ax25_ioctl, |
| 1964 | .listen = ax25_listen, | 1960 | .listen = ax25_listen, |
| 1965 | .shutdown = ax25_shutdown, | 1961 | .shutdown = ax25_shutdown, |
| 1966 | .setsockopt = ax25_setsockopt, | 1962 | .setsockopt = ax25_setsockopt, |
| 1967 | .getsockopt = ax25_getsockopt, | 1963 | .getsockopt = ax25_getsockopt, |
| 1968 | .sendmsg = ax25_sendmsg, | 1964 | .sendmsg = ax25_sendmsg, |
| 1969 | .recvmsg = ax25_recvmsg, | 1965 | .recvmsg = ax25_recvmsg, |
| 1970 | .mmap = sock_no_mmap, | 1966 | .mmap = sock_no_mmap, |
| 1971 | .sendpage = sock_no_sendpage, | 1967 | .sendpage = sock_no_sendpage, |
| 1972 | }; | 1968 | }; |
| 1973 | 1969 | ||
| 1974 | /* | 1970 | /* |
| @@ -1984,7 +1980,7 @@ static struct notifier_block ax25_dev_notifier = { | |||
| 1984 | .notifier_call =ax25_device_event, | 1980 | .notifier_call =ax25_device_event, |
| 1985 | }; | 1981 | }; |
| 1986 | 1982 | ||
| 1987 | EXPORT_SYMBOL(ax25_encapsulate); | 1983 | EXPORT_SYMBOL(ax25_hard_header); |
| 1988 | EXPORT_SYMBOL(ax25_rebuild_header); | 1984 | EXPORT_SYMBOL(ax25_rebuild_header); |
| 1989 | EXPORT_SYMBOL(ax25_findbyuid); | 1985 | EXPORT_SYMBOL(ax25_findbyuid); |
| 1990 | EXPORT_SYMBOL(ax25_find_cb); | 1986 | EXPORT_SYMBOL(ax25_find_cb); |
diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c index dca179daf415..0164a155b8c4 100644 --- a/net/ax25/ax25_addr.c +++ b/net/ax25/ax25_addr.c | |||
| @@ -67,37 +67,34 @@ char *ax2asc(char *buf, ax25_address *a) | |||
| 67 | /* | 67 | /* |
| 68 | * ascii -> ax25 conversion | 68 | * ascii -> ax25 conversion |
| 69 | */ | 69 | */ |
| 70 | ax25_address *asc2ax(char *callsign) | 70 | void asc2ax(ax25_address *addr, char *callsign) |
| 71 | { | 71 | { |
| 72 | static ax25_address addr; | ||
| 73 | char *s; | 72 | char *s; |
| 74 | int n; | 73 | int n; |
| 75 | 74 | ||
| 76 | for (s = callsign, n = 0; n < 6; n++) { | 75 | for (s = callsign, n = 0; n < 6; n++) { |
| 77 | if (*s != '\0' && *s != '-') | 76 | if (*s != '\0' && *s != '-') |
| 78 | addr.ax25_call[n] = *s++; | 77 | addr->ax25_call[n] = *s++; |
| 79 | else | 78 | else |
| 80 | addr.ax25_call[n] = ' '; | 79 | addr->ax25_call[n] = ' '; |
| 81 | addr.ax25_call[n] <<= 1; | 80 | addr->ax25_call[n] <<= 1; |
| 82 | addr.ax25_call[n] &= 0xFE; | 81 | addr->ax25_call[n] &= 0xFE; |
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | if (*s++ == '\0') { | 84 | if (*s++ == '\0') { |
| 86 | addr.ax25_call[6] = 0x00; | 85 | addr->ax25_call[6] = 0x00; |
| 87 | return &addr; | 86 | return; |
| 88 | } | 87 | } |
| 89 | 88 | ||
| 90 | addr.ax25_call[6] = *s++ - '0'; | 89 | addr->ax25_call[6] = *s++ - '0'; |
| 91 | 90 | ||
| 92 | if (*s != '\0') { | 91 | if (*s != '\0') { |
| 93 | addr.ax25_call[6] *= 10; | 92 | addr->ax25_call[6] *= 10; |
| 94 | addr.ax25_call[6] += *s++ - '0'; | 93 | addr->ax25_call[6] += *s++ - '0'; |
| 95 | } | 94 | } |
| 96 | 95 | ||
| 97 | addr.ax25_call[6] <<= 1; | 96 | addr->ax25_call[6] <<= 1; |
| 98 | addr.ax25_call[6] &= 0x1E; | 97 | addr->ax25_call[6] &= 0x1E; |
| 99 | |||
| 100 | return &addr; | ||
| 101 | } | 98 | } |
| 102 | 99 | ||
| 103 | /* | 100 | /* |
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index bba0173e2d65..d643dac3eccc 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c | |||
| @@ -47,7 +47,7 @@ | |||
| 47 | 47 | ||
| 48 | #ifdef CONFIG_INET | 48 | #ifdef CONFIG_INET |
| 49 | 49 | ||
| 50 | int ax25_encapsulate(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) | 50 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) |
| 51 | { | 51 | { |
| 52 | unsigned char *buff; | 52 | unsigned char *buff; |
| 53 | 53 | ||
| @@ -88,7 +88,7 @@ int ax25_encapsulate(struct sk_buff *skb, struct net_device *dev, unsigned short | |||
| 88 | *buff++ = AX25_P_ARP; | 88 | *buff++ = AX25_P_ARP; |
| 89 | break; | 89 | break; |
| 90 | default: | 90 | default: |
| 91 | printk(KERN_ERR "AX.25: ax25_encapsulate - wrong protocol type 0x%2.2x\n", type); | 91 | printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type); |
| 92 | *buff++ = 0; | 92 | *buff++ = 0; |
| 93 | break; | 93 | break; |
| 94 | } | 94 | } |
| @@ -209,7 +209,7 @@ put: | |||
| 209 | 209 | ||
| 210 | #else /* INET */ | 210 | #else /* INET */ |
| 211 | 211 | ||
| 212 | int ax25_encapsulate(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) | 212 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) |
| 213 | { | 213 | { |
| 214 | return -AX25_HEADER_LEN; | 214 | return -AX25_HEADER_LEN; |
| 215 | } | 215 | } |
