ip_print_ifs returns wrong MTU.

, , , ,

ip_print_ifs(); returns a MTU of 16 yet it is defined as 1500.

ifmtu(i, 0)); returns goofy values but ifmtu(i, _if_tab[0].ipaddr)); returns 1500.

in ip.lib

printf("%-4s %4u ", IF_P2P(i) ? (IF_PKT_ETH(i) ? “ppoe” : “ppp”) : IF_PKT_REAL_WIFI(i) ? “wifi”
: “eth”, ifmtu(i, _if_tab[i].ipaddr));

Returns 16

Something is very goofy.

You didn’t give any relevant information. What version of DC are you using? What Rabbit board are you using?

What networking parameters do you have set up? How did you set them up?

DC 10.72 and a RCM4310

#define TCPCONFIG 1 /* Static IP */
#define MY_GATEWAY “”
#define MY_NAMESERVER “”

GetIpAddress(IpAddress); //This reads the IP from a set of 8 hex rotary switches…

IFS_IPADDR, aton(IpAddress),
IFS_NETMASK, aton(“”),
while (ifpending(IF_ETH0) == 1) tcp_tick(NULL);


In DC 10.72 Function lookup:

SYNTAX: void ip_print_ifs(void)

KEYWORDS: tcpip, interface

DESCRIPTION: Print all interface table entries. This is for debugging
only, since the results are printed to the Dynamic C stdio

           There are 8 fields for each interface entry:
               the interface number
             IP addr:
               The local ("home") IP address of this interface.  May
               be if interface is not currently active.
               Local subnet mask.
               Indicates status; one of
                 Yes: interface currently active
                 No:  currently inactive
                 NYU: Not Yet Up i.e. coming up
                 NYD: Not Yet Down i.e. coming down
               Interface type; one of
                 eth: normal ethernet
                 ppp: PPP over serial port
                 pppoe: PPP over ethernet
               Maximum transmission unit.
               A list of the following characters:
                 * = this is the default interface (IF_DEFAULT)
                 D = Use DHCP
                 DD= Currently configured via DHCP
                 S = allow IP address configuration via directed
                     ping (ICMP echo).
                 SS= IP address currently set via directed ping
                 1 = IGMP version 1 router present on this interface
                 ->nn = Virtual interface on specified real i/f
               IP address of peer node (for PPP or PPPOE), or address
               of default router on this interface (for ethernet
               type).  May be blank or if no peer or router
               is available.

When I run display_mac.c on an RCM4310 I get

IP addr. Mask Up Lnk Type MTU Flags Peer/router

0 yes yes eth 16 *

When I run it on an RCM6750 I get

IP addr. Mask Up Lnk Type MTU Flags Peer/router

0 yes yes eth 1500 *

I would assume this is a bug as the MTU should be 1500 for ethernet and 1489 if WiFi and Rabbit 5000 or above.

Indeed, I looked into debugging it but gave up as I have more pressing issues.