diff options
Diffstat (limited to 'drivers/net/slip.c')
-rw-r--r-- | drivers/net/slip.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index fe3cebb984de..89696156c059 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -80,8 +80,10 @@ | |||
80 | #include <linux/rtnetlink.h> | 80 | #include <linux/rtnetlink.h> |
81 | #include <linux/if_arp.h> | 81 | #include <linux/if_arp.h> |
82 | #include <linux/if_slip.h> | 82 | #include <linux/if_slip.h> |
83 | #include <linux/compat.h> | ||
83 | #include <linux/delay.h> | 84 | #include <linux/delay.h> |
84 | #include <linux/init.h> | 85 | #include <linux/init.h> |
86 | #include <linux/slab.h> | ||
85 | #include "slip.h" | 87 | #include "slip.h" |
86 | #ifdef CONFIG_INET | 88 | #ifdef CONFIG_INET |
87 | #include <linux/ip.h> | 89 | #include <linux/ip.h> |
@@ -955,8 +957,8 @@ static void slip_unesc(struct slip *sl, unsigned char s) | |||
955 | clear_bit(SLF_KEEPTEST, &sl->flags); | 957 | clear_bit(SLF_KEEPTEST, &sl->flags); |
956 | #endif | 958 | #endif |
957 | 959 | ||
958 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 960 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
959 | && (sl->rcount > 2)) | 961 | (sl->rcount > 2)) |
960 | sl_bump(sl); | 962 | sl_bump(sl); |
961 | clear_bit(SLF_ESCAPE, &sl->flags); | 963 | clear_bit(SLF_ESCAPE, &sl->flags); |
962 | sl->rcount = 0; | 964 | sl->rcount = 0; |
@@ -1038,8 +1040,8 @@ static void slip_unesc6(struct slip *sl, unsigned char s) | |||
1038 | clear_bit(SLF_KEEPTEST, &sl->flags); | 1040 | clear_bit(SLF_KEEPTEST, &sl->flags); |
1039 | #endif | 1041 | #endif |
1040 | 1042 | ||
1041 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) | 1043 | if (!test_and_clear_bit(SLF_ERROR, &sl->flags) && |
1042 | && (sl->rcount > 2)) | 1044 | (sl->rcount > 2)) |
1043 | sl_bump(sl); | 1045 | sl_bump(sl); |
1044 | sl->rcount = 0; | 1046 | sl->rcount = 0; |
1045 | sl->xbits = 0; | 1047 | sl->xbits = 0; |
@@ -1169,6 +1171,27 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, | |||
1169 | } | 1171 | } |
1170 | } | 1172 | } |
1171 | 1173 | ||
1174 | #ifdef CONFIG_COMPAT | ||
1175 | static long slip_compat_ioctl(struct tty_struct *tty, struct file *file, | ||
1176 | unsigned int cmd, unsigned long arg) | ||
1177 | { | ||
1178 | switch (cmd) { | ||
1179 | case SIOCGIFNAME: | ||
1180 | case SIOCGIFENCAP: | ||
1181 | case SIOCSIFENCAP: | ||
1182 | case SIOCSIFHWADDR: | ||
1183 | case SIOCSKEEPALIVE: | ||
1184 | case SIOCGKEEPALIVE: | ||
1185 | case SIOCSOUTFILL: | ||
1186 | case SIOCGOUTFILL: | ||
1187 | return slip_ioctl(tty, file, cmd, | ||
1188 | (unsigned long)compat_ptr(arg)); | ||
1189 | } | ||
1190 | |||
1191 | return -ENOIOCTLCMD; | ||
1192 | } | ||
1193 | #endif | ||
1194 | |||
1172 | /* VSV changes start here */ | 1195 | /* VSV changes start here */ |
1173 | #ifdef CONFIG_SLIP_SMART | 1196 | #ifdef CONFIG_SLIP_SMART |
1174 | /* function do_ioctl called from net/core/dev.c | 1197 | /* function do_ioctl called from net/core/dev.c |
@@ -1261,6 +1284,9 @@ static struct tty_ldisc_ops sl_ldisc = { | |||
1261 | .close = slip_close, | 1284 | .close = slip_close, |
1262 | .hangup = slip_hangup, | 1285 | .hangup = slip_hangup, |
1263 | .ioctl = slip_ioctl, | 1286 | .ioctl = slip_ioctl, |
1287 | #ifdef CONFIG_COMPAT | ||
1288 | .compat_ioctl = slip_compat_ioctl, | ||
1289 | #endif | ||
1264 | .receive_buf = slip_receive_buf, | 1290 | .receive_buf = slip_receive_buf, |
1265 | .write_wakeup = slip_write_wakeup, | 1291 | .write_wakeup = slip_write_wakeup, |
1266 | }; | 1292 | }; |