Decouple IP mtu for ARCnet devices from interface MTU.
This is important, because for most protocols, link level fragmentation is used, but with different default effective MTUs. (e.g.: IPv4 default MTU is 1500 octets, IPv6 default MTU is 9072 octets).
This commit is contained in:
parent
d7e2fcf851
commit
f546d949b6
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files,v 1.316 1999/09/19 21:48:09 ad Exp $
|
||||
# $NetBSD: files,v 1.317 1999/09/25 17:49:27 is Exp $
|
||||
|
||||
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
|
||||
|
||||
|
@ -709,7 +709,7 @@ file net/bpf.c bpfilter needs-count
|
|||
file net/bpf_filter.c bpfilter | ppp
|
||||
file net/bsd-comp.c ppp & ppp_bsdcomp
|
||||
file net/if.c
|
||||
file net/if_arcsubr.c arc
|
||||
file net/if_arcsubr.c arc needs-flag
|
||||
file net/if_atmsubr.c atm
|
||||
file net/if_ethersubr.c ether | fddi | netatalk | token
|
||||
file net/if_fddisubr.c fddi needs-flag
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arc.h,v 1.11 1999/08/27 19:23:19 is Exp $ */
|
||||
/* $NetBSD: if_arc.h,v 1.12 1999/09/25 17:49:28 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
|
@ -102,6 +102,8 @@ struct arc_header {
|
|||
#define ARCMTU 507
|
||||
#define ARCMIN 0
|
||||
|
||||
#define ARC_PHDS_MAXMTU 60480
|
||||
|
||||
struct arccom {
|
||||
struct ifnet ac_if; /* network-visible interface */
|
||||
|
||||
|
@ -118,6 +120,7 @@ struct arccom {
|
|||
|
||||
#ifdef _KERNEL
|
||||
u_int8_t arcbroadcastaddr;
|
||||
extern int arc_ipmtu; /* XXX new ip only, no RFC 1051! */
|
||||
|
||||
void arc_ifattach __P((struct ifnet *, u_int8_t));
|
||||
void arc_storelladdr __P((struct ifnet *, u_int8_t));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arcsubr.c,v 1.27 1999/09/19 21:31:33 is Exp $ */
|
||||
/* $NetBSD: if_arcsubr.c,v 1.28 1999/09/25 17:49:28 is Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Ignatios Souvatzis
|
||||
|
@ -78,8 +78,8 @@
|
|||
|
||||
#define ARCNET_ALLOW_BROKEN_ARP
|
||||
|
||||
#ifndef ARC_PHDSMTU
|
||||
#define ARC_PHDSMTU 1500
|
||||
#ifndef ARC_IPMTU
|
||||
#define ARC_IPMTU 1500
|
||||
#endif
|
||||
|
||||
static struct mbuf *arc_defrag __P((struct ifnet *, struct mbuf *));
|
||||
|
@ -90,10 +90,10 @@ static struct mbuf *arc_defrag __P((struct ifnet *, struct mbuf *));
|
|||
* Anyway, it is possible to binpatch this or set it per kernel config
|
||||
* option.
|
||||
*/
|
||||
#if ARC_PHDSMTU > 60480
|
||||
ERROR: The arc_phdsmtu is ARC_PHDSMTU, but must not exceed 60480.
|
||||
#if ARC_IPMTU > 60480
|
||||
ERROR: The arc_ipmtu is ARC_IPMTU, but must not exceed 60480.
|
||||
#endif
|
||||
u_int16_t arc_phdsmtu = ARC_PHDSMTU;
|
||||
int arc_ipmtu = ARC_IPMTU;
|
||||
u_int8_t arcbroadcastaddr = 0;
|
||||
|
||||
#define senderr(e) { error = (e); goto bad;}
|
||||
|
@ -666,7 +666,7 @@ arc_storelladdr(ifp, lla)
|
|||
sdl->sdl_alen = ifp->if_addrlen;
|
||||
*(LLADDR(sdl)) = lla;
|
||||
}
|
||||
ifp->if_mtu = (ifp->if_flags & IFF_LINK0 ? arc_phdsmtu : ARCMTU);
|
||||
ifp->if_mtu = ARC_PHDS_MAXMTU;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -684,10 +684,10 @@ arc_ifattach(ifp, lla)
|
|||
ifp->if_hdrlen = ARC_HDRLEN;
|
||||
if (ifp->if_flags & IFF_BROADCAST)
|
||||
ifp->if_flags |= IFF_MULTICAST|IFF_ALLMULTI;
|
||||
if (ifp->if_flags & IFF_LINK0 && arc_phdsmtu > 60480)
|
||||
if (ifp->if_flags & IFF_LINK0 && arc_ipmtu > ARC_PHDS_MAXMTU)
|
||||
log(LOG_ERR,
|
||||
"%s: arc_phdsmtu is %d, but must not exceed 60480",
|
||||
ifp->if_xname, arc_phdsmtu);
|
||||
"%s: arc_ipmtu is %d, but must not exceed %d",
|
||||
ifp->if_xname, arc_ipmtu, ARC_PHDS_MAXMTU);
|
||||
|
||||
ifp->if_output = arc_output;
|
||||
ifp->if_input = arc_input;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_arp.c,v 1.65 1999/08/21 03:46:35 matt Exp $ */
|
||||
/* $NetBSD: if_arp.c,v 1.66 1999/09/25 17:49:29 is Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -112,11 +112,16 @@
|
|||
#include <netinet/if_inarp.h>
|
||||
|
||||
#include "loop.h"
|
||||
#include "arc.h"
|
||||
#if NARC > 0
|
||||
#include <net/if_arc.h>
|
||||
#endif
|
||||
#include "fddi.h"
|
||||
#if NFDDI > 0
|
||||
#include <net/if_fddi.h>
|
||||
#endif
|
||||
#include "token.h"
|
||||
#include "token.h"
|
||||
|
||||
#define SIN(s) ((struct sockaddr_in *)s)
|
||||
#define SDL(s) ((struct sockaddr_dl *)s)
|
||||
|
@ -410,6 +415,22 @@ arp_rtrequest(req, rt, sa)
|
|||
&& rt->rt_ifp->if_mtu > FDDIIPMTU))) {
|
||||
rt->rt_rmx.rmx_mtu = FDDIIPMTU;
|
||||
}
|
||||
#endif
|
||||
#if NARC > 0
|
||||
if (rt->rt_ifp->if_type == IFT_ARCNET) {
|
||||
int arcipifmtu;
|
||||
|
||||
if (rt->rt_ifp->if_flags & IFF_LINK0)
|
||||
arcipifmtu = arc_ipmtu;
|
||||
else
|
||||
arcipifmtu = ARCMTU;
|
||||
|
||||
if (rt->rt_rmx.rmx_mtu > arcipifmtu ||
|
||||
(rt->rt_rmx.rmx_mtu == 0 &&
|
||||
rt->rt_ifp->if_mtu > arcipifmtu))
|
||||
|
||||
rt->rt_rmx.rmx_mtu = arcipifmtu;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue