Subject: tun(4) minimum mtu is 576, can I safely make this smaller?
To: None <tech-kern@netbsd.org, tech-net@netbsd.org>
From: Tad Hunt <tad@entrisphere.com>
List: tech-kern
Date: 10/08/2002 15:02:53
I'm working on an application which forwards packets received
on from the tun(4) device on /dev/tunN on one host, over a
network (LAPD, actually) with a maximum packet size of 512 bytes,
back into another NetBSD /dev/tunN on the other end.

I would like to set the MTU on the tun(4) interface to a number
smaller than the currently allowed minimum which is
hardcoded to 576.

int
tun_ioctl(ifp, cmd, data)
{
	...
	case SIOCSIFMTU: {
		struct ifreq *ifr = (struct ifreq *) data;
		if (ifr->ifr_mtu > TUNMTU || ifr->ifr_mtu < 576) {
		    error = EINVAL;
		    break;
		}
		TUNDEBUG("%s: interface mtu set\n", ifp->if_xname);
		ifp->if_mtu = ifr->ifr_mtu;
		break;
	}
	...
}


Can I safely reduce this number, or will it cause problems?

Thanks,
	-Tad