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