diff options
Diffstat (limited to 'net/rose')
-rw-r--r-- | net/rose/af_rose.c | 14 | ||||
-rw-r--r-- | net/rose/sysctl_net_rose.c | 40 |
2 files changed, 32 insertions, 22 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index a7f1ce11bc22..01392649b462 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -690,7 +690,7 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
690 | 690 | ||
691 | source = &addr->srose_call; | 691 | source = &addr->srose_call; |
692 | 692 | ||
693 | user = ax25_findbyuid(current->euid); | 693 | user = ax25_findbyuid(current_euid()); |
694 | if (user) { | 694 | if (user) { |
695 | rose->source_call = user->call; | 695 | rose->source_call = user->call; |
696 | ax25_uid_put(user); | 696 | ax25_uid_put(user); |
@@ -791,7 +791,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
791 | goto out_release; | 791 | goto out_release; |
792 | } | 792 | } |
793 | 793 | ||
794 | user = ax25_findbyuid(current->euid); | 794 | user = ax25_findbyuid(current_euid()); |
795 | if (!user) { | 795 | if (!user) { |
796 | err = -EINVAL; | 796 | err = -EINVAL; |
797 | goto out_release; | 797 | goto out_release; |
@@ -1072,6 +1072,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1072 | unsigned char *asmptr; | 1072 | unsigned char *asmptr; |
1073 | int n, size, qbit = 0; | 1073 | int n, size, qbit = 0; |
1074 | 1074 | ||
1075 | /* ROSE empty frame has no meaning : don't send */ | ||
1076 | if (len == 0) | ||
1077 | return 0; | ||
1078 | |||
1075 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) | 1079 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) |
1076 | return -EINVAL; | 1080 | return -EINVAL; |
1077 | 1081 | ||
@@ -1265,6 +1269,12 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1265 | skb_reset_transport_header(skb); | 1269 | skb_reset_transport_header(skb); |
1266 | copied = skb->len; | 1270 | copied = skb->len; |
1267 | 1271 | ||
1272 | /* ROSE empty frame has no meaning : ignore it */ | ||
1273 | if (copied == 0) { | ||
1274 | skb_free_datagram(sk, skb); | ||
1275 | return copied; | ||
1276 | } | ||
1277 | |||
1268 | if (copied > size) { | 1278 | if (copied > size) { |
1269 | copied = size; | 1279 | copied = size; |
1270 | msg->msg_flags |= MSG_TRUNC; | 1280 | msg->msg_flags |= MSG_TRUNC; |
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c index 20be3485a97f..3bfe504faf86 100644 --- a/net/rose/sysctl_net_rose.c +++ b/net/rose/sysctl_net_rose.c | |||
@@ -31,8 +31,8 @@ static ctl_table rose_table[] = { | |||
31 | .data = &sysctl_rose_restart_request_timeout, | 31 | .data = &sysctl_rose_restart_request_timeout, |
32 | .maxlen = sizeof(int), | 32 | .maxlen = sizeof(int), |
33 | .mode = 0644, | 33 | .mode = 0644, |
34 | .proc_handler = &proc_dointvec_minmax, | 34 | .proc_handler = proc_dointvec_minmax, |
35 | .strategy = &sysctl_intvec, | 35 | .strategy = sysctl_intvec, |
36 | .extra1 = &min_timer, | 36 | .extra1 = &min_timer, |
37 | .extra2 = &max_timer | 37 | .extra2 = &max_timer |
38 | }, | 38 | }, |
@@ -42,8 +42,8 @@ static ctl_table rose_table[] = { | |||
42 | .data = &sysctl_rose_call_request_timeout, | 42 | .data = &sysctl_rose_call_request_timeout, |
43 | .maxlen = sizeof(int), | 43 | .maxlen = sizeof(int), |
44 | .mode = 0644, | 44 | .mode = 0644, |
45 | .proc_handler = &proc_dointvec_minmax, | 45 | .proc_handler = proc_dointvec_minmax, |
46 | .strategy = &sysctl_intvec, | 46 | .strategy = sysctl_intvec, |
47 | .extra1 = &min_timer, | 47 | .extra1 = &min_timer, |
48 | .extra2 = &max_timer | 48 | .extra2 = &max_timer |
49 | }, | 49 | }, |
@@ -53,8 +53,8 @@ static ctl_table rose_table[] = { | |||
53 | .data = &sysctl_rose_reset_request_timeout, | 53 | .data = &sysctl_rose_reset_request_timeout, |
54 | .maxlen = sizeof(int), | 54 | .maxlen = sizeof(int), |
55 | .mode = 0644, | 55 | .mode = 0644, |
56 | .proc_handler = &proc_dointvec_minmax, | 56 | .proc_handler = proc_dointvec_minmax, |
57 | .strategy = &sysctl_intvec, | 57 | .strategy = sysctl_intvec, |
58 | .extra1 = &min_timer, | 58 | .extra1 = &min_timer, |
59 | .extra2 = &max_timer | 59 | .extra2 = &max_timer |
60 | }, | 60 | }, |
@@ -64,8 +64,8 @@ static ctl_table rose_table[] = { | |||
64 | .data = &sysctl_rose_clear_request_timeout, | 64 | .data = &sysctl_rose_clear_request_timeout, |
65 | .maxlen = sizeof(int), | 65 | .maxlen = sizeof(int), |
66 | .mode = 0644, | 66 | .mode = 0644, |
67 | .proc_handler = &proc_dointvec_minmax, | 67 | .proc_handler = proc_dointvec_minmax, |
68 | .strategy = &sysctl_intvec, | 68 | .strategy = sysctl_intvec, |
69 | .extra1 = &min_timer, | 69 | .extra1 = &min_timer, |
70 | .extra2 = &max_timer | 70 | .extra2 = &max_timer |
71 | }, | 71 | }, |
@@ -75,8 +75,8 @@ static ctl_table rose_table[] = { | |||
75 | .data = &sysctl_rose_no_activity_timeout, | 75 | .data = &sysctl_rose_no_activity_timeout, |
76 | .maxlen = sizeof(int), | 76 | .maxlen = sizeof(int), |
77 | .mode = 0644, | 77 | .mode = 0644, |
78 | .proc_handler = &proc_dointvec_minmax, | 78 | .proc_handler = proc_dointvec_minmax, |
79 | .strategy = &sysctl_intvec, | 79 | .strategy = sysctl_intvec, |
80 | .extra1 = &min_idle, | 80 | .extra1 = &min_idle, |
81 | .extra2 = &max_idle | 81 | .extra2 = &max_idle |
82 | }, | 82 | }, |
@@ -86,8 +86,8 @@ static ctl_table rose_table[] = { | |||
86 | .data = &sysctl_rose_ack_hold_back_timeout, | 86 | .data = &sysctl_rose_ack_hold_back_timeout, |
87 | .maxlen = sizeof(int), | 87 | .maxlen = sizeof(int), |
88 | .mode = 0644, | 88 | .mode = 0644, |
89 | .proc_handler = &proc_dointvec_minmax, | 89 | .proc_handler = proc_dointvec_minmax, |
90 | .strategy = &sysctl_intvec, | 90 | .strategy = sysctl_intvec, |
91 | .extra1 = &min_timer, | 91 | .extra1 = &min_timer, |
92 | .extra2 = &max_timer | 92 | .extra2 = &max_timer |
93 | }, | 93 | }, |
@@ -97,8 +97,8 @@ static ctl_table rose_table[] = { | |||
97 | .data = &sysctl_rose_routing_control, | 97 | .data = &sysctl_rose_routing_control, |
98 | .maxlen = sizeof(int), | 98 | .maxlen = sizeof(int), |
99 | .mode = 0644, | 99 | .mode = 0644, |
100 | .proc_handler = &proc_dointvec_minmax, | 100 | .proc_handler = proc_dointvec_minmax, |
101 | .strategy = &sysctl_intvec, | 101 | .strategy = sysctl_intvec, |
102 | .extra1 = &min_route, | 102 | .extra1 = &min_route, |
103 | .extra2 = &max_route | 103 | .extra2 = &max_route |
104 | }, | 104 | }, |
@@ -108,8 +108,8 @@ static ctl_table rose_table[] = { | |||
108 | .data = &sysctl_rose_link_fail_timeout, | 108 | .data = &sysctl_rose_link_fail_timeout, |
109 | .maxlen = sizeof(int), | 109 | .maxlen = sizeof(int), |
110 | .mode = 0644, | 110 | .mode = 0644, |
111 | .proc_handler = &proc_dointvec_minmax, | 111 | .proc_handler = proc_dointvec_minmax, |
112 | .strategy = &sysctl_intvec, | 112 | .strategy = sysctl_intvec, |
113 | .extra1 = &min_ftimer, | 113 | .extra1 = &min_ftimer, |
114 | .extra2 = &max_ftimer | 114 | .extra2 = &max_ftimer |
115 | }, | 115 | }, |
@@ -119,8 +119,8 @@ static ctl_table rose_table[] = { | |||
119 | .data = &sysctl_rose_maximum_vcs, | 119 | .data = &sysctl_rose_maximum_vcs, |
120 | .maxlen = sizeof(int), | 120 | .maxlen = sizeof(int), |
121 | .mode = 0644, | 121 | .mode = 0644, |
122 | .proc_handler = &proc_dointvec_minmax, | 122 | .proc_handler = proc_dointvec_minmax, |
123 | .strategy = &sysctl_intvec, | 123 | .strategy = sysctl_intvec, |
124 | .extra1 = &min_maxvcs, | 124 | .extra1 = &min_maxvcs, |
125 | .extra2 = &max_maxvcs | 125 | .extra2 = &max_maxvcs |
126 | }, | 126 | }, |
@@ -130,8 +130,8 @@ static ctl_table rose_table[] = { | |||
130 | .data = &sysctl_rose_window_size, | 130 | .data = &sysctl_rose_window_size, |
131 | .maxlen = sizeof(int), | 131 | .maxlen = sizeof(int), |
132 | .mode = 0644, | 132 | .mode = 0644, |
133 | .proc_handler = &proc_dointvec_minmax, | 133 | .proc_handler = proc_dointvec_minmax, |
134 | .strategy = &sysctl_intvec, | 134 | .strategy = sysctl_intvec, |
135 | .extra1 = &min_window, | 135 | .extra1 = &min_window, |
136 | .extra2 = &max_window | 136 | .extra2 = &max_window |
137 | }, | 137 | }, |