# ioctl SIOCSIFMTU: Invalid argument. MTU issue?

## turtles

When my ndiswrapper powered pcmcia wireless card starts up I see:

```
* Starting wlan0

 *   Configuring wireless network for wlan0

 *     wlan0 connected to ESSID "lightning" at 00:09:5B:2B:70:F9

 *     in managed mode on channel 11 (WEP disabled)

 *   Bringing up wlan0

 *     dhcp

 *       Running dhcpcd ...

Error, wlan0: ioctl SIOCSIFMTU: Invalid argument                              [ ok ]

 *       wlan0 received address 192.168.0.3/24

```

Strace gives me:

```
strace -e trace=ioctl ifconfig wlan0:1 >/dev/null

ioctl(5, SIOCGIFFLAGS, {ifr_name="wlan0:1", ifr_flags=IFF_UP|IFF_BROADCAST|IFF_RUNNING|IFF_MULTICAST}) = 0

ioctl(5, SIOCGIFHWADDR, {ifr_name="wlan0:1", ifr_hwaddr=00:03:2f:38:16:78}) = 0

ioctl(5, SIOCGIFMETRIC, {ifr_name="wlan0:1", ifr_metric=0}) = 0

ioctl(5, SIOCGIFMTU, {ifr_name="wlan0:1", ifr_mtu=1500}) = 0

ioctl(5, SIOCGIFMAP, {ifr_name="wlan0:1", ifr_map={mem_start=0x90010000, mem_end=0x90020000, base_addr=0, irq=16, dma=0, port=0}}) = 0

ioctl(5, SIOCGIFMAP, {ifr_name="wlan0:1", ifr_map={mem_start=0x90010000, mem_end=0x90020000, base_addr=0, irq=16, dma=0, port=0}}) = 0

ioctl(5, SIOCGIFTXQLEN, {ifr_name="wlan0:1", ifr_qlen=1000}) = 0

ioctl(4, SIOCGIFADDR, {ifr_name="wlan0:1", ???}) = -1 EADDRNOTAVAIL (Cannot assign requested address)

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfab6e7c) = -1 ENOTTY (Inappropriate ioctl for device)

lapcat turtle # ifconfig wlan0

wlan0     Link encap:Ethernet  HWaddr 00:03:2F:38:16:78

          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::203:2fff:fe38:1678/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:44187 errors:0 dropped:0 overruns:0 frame:0

          TX packets:24458 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:16315270 (15.5 Mb)  TX bytes:4375055 (4.1 Mb)

          Interrupt:16 Memory:90010000-90020000

```

There are also a coupple other non reported errors:

```
strace -e trace=ioctl iwconfig wlan0:1 >/dev/null

ioctl(3, SIOCGIWNAME, 0xbf88514c)       = 0

ioctl(3, SIOCGIWNWID, 0xbf88514c)       = -1 EOPNOTSUPP (Operation not supported)

ioctl(3, SIOCGIWFREQ, 0xbf88514c)       = 0

ioctl(3, SIOCGIWENCODE, 0xbf88514c)     = 0

ioctl(3, SIOCGIWESSID, 0xbf88514c)      = 0

ioctl(3, SIOCGIWMODE, 0xbf88514c)       = 0

ioctl(3, SIOCGIWRANGE, 0xbf88514c)      = 0

ioctl(3, SIOCGIWAP, 0xbf885620)         = 0

ioctl(3, SIOCGIWRATE, 0xbf885620)       = 0

ioctl(3, SIOCGIWPOWER, 0xbf885620)      = 0

ioctl(3, SIOCGIWSTATS, 0xbf885148)      = 0

ioctl(3, SIOCGIWNICKN, 0xbf885620)      = 0

ioctl(3, SIOCGIWTXPOW, 0xbf885620)      = -1 EOPNOTSUPP (Operation not supported)

ioctl(3, SIOCGIWSENS, 0xbf885620)       = 0

ioctl(3, SIOCGIWRETRY, 0xbf885620)      = -1 EOPNOTSUPP (Operation not supported)

ioctl(3, SIOCGIWRTS, 0xbf885620)        = 0

ioctl(3, SIOCGIWFRAG, 0xbf885620)       = 0

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf8849cc) = -1 ENOTTY (Inappropriate ioctl for device)

```

I got the 3com driver from the ndiswrapper site it is #34 Card: Airlink+ 802.11g Model AWLC3026.

The drivers that came with the card never worked.

I noticed there is a libertas driver in the kernel now and maybe that would work better but I have not been able to get it to work. 

Here is some dmesg info 

```
dmesg | grep 'ndiswrapper' && dmesg | grep 'wlan0'

ndiswrapper version 1.50 loaded (smp=yes, preempt=no)

usbcore: registered new interface driver ndiswrapper

ndiswrapper: driver mrv8000c (Airlink101,02/22/2005,3.1.1.7) loaded

ndiswrapper: using IRQ 16

Device driver wlan0 lacks bus and class support for being resumed.

wlan0: ethernet device 00:03:2f:38:16:78 using NDIS driver: mrv8000c, version: 0x3000036, NDIS version: 0x501, vendor: 'NDIS Network Adapter', 11AB:1FAA.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

ADDRCONF(NETDEV_UP): wlan0: link is not ready

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: no IPv6 routers present

ndiswrapper (mp_set_power_state:371): wlan0 does not support power management; halting the device

wlan0: no IPv6 routers present

ndiswrapper: device wlan0 removed

Device driver wlan0 lacks bus and class support for being resumed.

wlan0: ethernet device 00:03:2f:38:16:78 using NDIS driver: mrv8000c, version: 0x3000036, NDIS version: 0x501, vendor: 'NDIS Network Adapter', 11AB:1FAA.5.conf

wlan0: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

ADDRCONF(NETDEV_UP): wlan0: link is not ready

ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

wlan0: no IPv6 routers present

```

Not really a critical issue at all just curious.

----------

## ltboy

Those errors for Intel cards is because of a problem where the driver wants the wifi stack to be built directly into the kernel, but another user with an rt73 tried that and the driver started locking up his computer. Just a thought though, probably should just make sure you disable your card then load it manually after you boot up.

----------

## turtles

It is a pcmcia card (hotpluged) so I dont always boot with the card in. The messages above are gotten when the system is running or booting. I think PCMCIAutils detects the presence of a card and hands it over to udev which loads the module ndiswrapper which allocates memory and wraps the windows driver. So it has got to be the kernel ndiswrapper or the windows driver in my mind. 

Like I said it is not a problem the card works great. Just sometimes when it looses connection I have to wonder about that error. It has to do with MTU size and 1500 is a standard size and it appears to be set to 1500 so maybe it is complaining about nothing.

Is there any way to test the MTU size?

Edit it is only at certain accesspoints like my primary one.

----------

