From: Matthew Wilcox <willy@debian.org>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: [PATCH] update packet & wanpipe ioctl routines
Date: Thu, 31 Oct 2002 19:02:05 +0000 [thread overview]
Message-ID: <20021031190205.M27461@parcelfarce.linux.theplanet.co.uk> (raw)
Convert af_packet.c and af_wanpipe.c to call dev_ioctl by default. I'm
less than convinced these protocols should be calling inet_ioctl, but I'm
not going to change that behaviour.
diff -urpNX dontdiff linux-2.5.45/net/packet/af_packet.c linux-2.5.45-willy/net/packet/af_packet.c
--- linux-2.5.45/net/packet/af_packet.c 2002-10-31 10:28:10.000000000 -0500
+++ linux-2.5.45-willy/net/packet/af_packet.c 2002-10-29 17:25:30.000000000 -0500
@@ -1432,8 +1432,7 @@ static int packet_ioctl(struct socket *s
{
struct sock *sk = sock->sk;
- switch(cmd)
- {
+ switch(cmd) {
case SIOCOUTQ:
{
int amount = atomic_read(&sk->wmem_alloc);
@@ -1452,35 +1451,12 @@ static int packet_ioctl(struct socket *s
return put_user(amount, (int *)arg);
}
case SIOCGSTAMP:
- if(sk->stamp.tv_sec==0)
+ if (sk->stamp.tv_sec==0)
return -ENOENT;
if (copy_to_user((void *)arg, &sk->stamp,
sizeof(struct timeval)))
return -EFAULT;
break;
- case SIOCGIFFLAGS:
-#ifndef CONFIG_INET
- case SIOCSIFFLAGS:
-#endif
- case SIOCGIFCONF:
- case SIOCGIFMETRIC:
- case SIOCSIFMETRIC:
- case SIOCGIFMEM:
- case SIOCSIFMEM:
- case SIOCGIFMTU:
- case SIOCSIFMTU:
- case SIOCSIFLINK:
- case SIOCGIFHWADDR:
- case SIOCSIFHWADDR:
- case SIOCSIFMAP:
- case SIOCGIFMAP:
- case SIOCSIFSLAVE:
- case SIOCGIFSLAVE:
- case SIOCGIFINDEX:
- case SIOCGIFNAME:
- case SIOCGIFCOUNT:
- case SIOCSIFHWBROADCAST:
- return(dev_ioctl(cmd,(void *) arg));
#ifdef CONFIG_INET
case SIOCADDRT:
@@ -1501,7 +1477,7 @@ static int packet_ioctl(struct socket *s
#endif
default:
- return -EOPNOTSUPP;
+ return dev_ioctl(cmd, (void *)arg);
}
return 0;
}
diff -urpNX dontdiff linux-2.5.45/net/wanrouter/af_wanpipe.c linux-2.5.45-willy/net/wanrouter/af_wanpipe.c
--- linux-2.5.45/net/wanrouter/af_wanpipe.c 2002-10-31 10:28:10.000000000 -0500
+++ linux-2.5.45-willy/net/wanrouter/af_wanpipe.c 2002-10-29 16:34:36.000000000 -0500
@@ -1922,30 +1922,6 @@ static int wanpipe_ioctl(struct socket *
sock->file->f_flags |= O_NONBLOCK;
return 0;
- case SIOCGIFFLAGS:
-#ifndef CONFIG_INET
- case SIOCSIFFLAGS:
-#endif
- case SIOCGIFCONF:
- case SIOCGIFMETRIC:
- case SIOCSIFMETRIC:
- case SIOCGIFMEM:
- case SIOCSIFMEM:
- case SIOCGIFMTU:
- case SIOCSIFMTU:
- case SIOCSIFLINK:
- case SIOCGIFHWADDR:
- case SIOCSIFHWADDR:
- case SIOCSIFMAP:
- case SIOCGIFMAP:
- case SIOCSIFSLAVE:
- case SIOCGIFSLAVE:
- case SIOCGIFINDEX:
- case SIOCGIFNAME:
- case SIOCGIFCOUNT:
- case SIOCSIFHWBROADCAST:
- return(dev_ioctl(cmd,(void *) arg));
-
#ifdef CONFIG_INET
case SIOCADDRT:
case SIOCDELRT:
@@ -1968,7 +1944,7 @@ static int wanpipe_ioctl(struct socket *
#endif
default:
- return -EOPNOTSUPP;
+ return dev_ioctl(cmd,(void *) arg);
}
/*NOTREACHED*/
}
--
Revolutions do not require corporate support.
next reply other threads:[~2002-10-31 18:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-31 19:02 Matthew Wilcox [this message]
2002-10-31 19:43 ` kernel.org is down? Gabor MICSKO
2002-10-31 20:09 ` Kasper Dupont
2002-11-02 10:24 ` [PATCH] update packet & wanpipe ioctl routines David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021031190205.M27461@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox