diff options
author | dg <dg@FreeBSD.org> | 1996-12-10 07:29:50 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1996-12-10 07:29:50 +0000 |
commit | 1665979d2e5ce0eb4858dedb47572346ff1eadef (patch) | |
tree | 6dd10ac37eb6c182f025fad192efc51d37c719ca /sys/net | |
parent | 46f2dd81651991d6e396015c9ce7929a0ca242ec (diff) | |
download | FreeBSD-src-1665979d2e5ce0eb4858dedb47572346ff1eadef.zip FreeBSD-src-1665979d2e5ce0eb4858dedb47572346ff1eadef.tar.gz |
1) Implement SIOCSIFMTU in ether_ioctl(), and change ether_ioctl's return
type to be int so that errors can be returned.
2) Use the new SIOCSIFMTU ether_ioctl support in the few drivers that are
using ether_ioctl().
3) In if_fxp.c: treat if_bpf as a token, not as a pointer. Don't bother
testing for FXP_NTXSEG being reached in fxp_start()...just check for
non-NULL 'm'. Change fxp_ioctl() to use ether_ioctl().
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.h | 4 | ||||
-rw-r--r-- | sys/net/if_ethersubr.c | 18 |
2 files changed, 17 insertions, 5 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index 67a7c17..9d7985a 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $Id: if.h,v 1.35 1996/10/12 19:49:22 bde Exp $ + * $Id: if.h,v 1.36 1996/10/21 23:05:57 fenner Exp $ */ #ifndef _NET_IF_H_ @@ -418,7 +418,7 @@ void ether_ifattach __P((struct ifnet *)); void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *)); int ether_output __P((struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *)); -void ether_ioctl __P((struct ifnet *, int , caddr_t )); +int ether_ioctl __P((struct ifnet *, int, caddr_t)); void if_attach __P((struct ifnet *)); void if_down __P((struct ifnet *)); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 8ca3e60..bdcdde7 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ethersubr.c,v 1.26 1996/10/18 15:59:25 jkh Exp $ + * $Id: if_ethersubr.c,v 1.27 1996/11/18 04:55:44 davidg Exp $ */ #include <sys/param.h> @@ -848,11 +848,12 @@ ether_delmulti(ifr, ac) SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet"); -void +int ether_ioctl(struct ifnet *ifp, int command, caddr_t data) { struct ifaddr *ifa = (struct ifaddr *) data; struct ifreq *ifr = (struct ifreq *) data; + int error = 0; switch (command) { case SIOCSIFADDR: @@ -931,6 +932,17 @@ ether_ioctl(struct ifnet *ifp, int command, caddr_t data) (caddr_t) sa->sa_data, ETHER_ADDR_LEN); } break; + + case SIOCSIFMTU: + /* + * Set the interface MTU. + */ + if (ifr->ifr_mtu > ETHERMTU) { + error = EINVAL; + } else { + ifp->if_mtu = ifr->ifr_mtu; + } + break; } - return; + return (error); } |