summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
df07bd9)
SCCS-vsn: sys/net/if.c 4.15
SCCS-vsn: sys/net/route.c 4.7
-/* if.c 4.14 82/04/24 */
+/* if.c 4.15 82/05/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
{
register struct ifnet *ifp;
register int af = addr->sa_family;
{
register struct ifnet *ifp;
register int af = addr->sa_family;
- register int (*netmatch)() = afswitch[af].af_netmatch;
+ register int (*netmatch)();
+ if (af >= AF_MAX)
+ return (0);
+ netmatch = afswitch[af].af_netmatch;
for (ifp = ifnet; ifp; ifp = ifp->if_next) {
if (af != ifp->if_addr.sa_family)
continue;
for (ifp = ifnet; ifp; ifp = ifp->if_next) {
if (af != ifp->if_addr.sa_family)
continue;
-/* route.c 4.6 82/03/31 */
+/* route.c 4.7 82/05/04 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
COUNT(RTALLOC);
if (ro->ro_rt && ro->ro_rt->rt_ifp) /* XXX */
return;
COUNT(RTALLOC);
if (ro->ro_rt && ro->ro_rt->rt_ifp) /* XXX */
return;
+ if (af >= AF_MAX)
+ return;
(*afswitch[af].af_hash)(dst, &h);
rtmin = 0, hash = h.afh_hosthash;
for (m = rthost[hash % RTHASHSIZ]; m; m = m->m_next) {
(*afswitch[af].af_hash)(dst, &h);
rtmin = 0, hash = h.afh_hosthash;
for (m = rthost[hash % RTHASHSIZ]; m; m = m->m_next) {
int af = sa->sa_family, doinghost, s, error = 0;
COUNT(RTREQUEST);
int af = sa->sa_family, doinghost, s, error = 0;
COUNT(RTREQUEST);
+ if (af >= AF_MAX)
+ return (EAFNOSUPPORT);
(*afswitch[af].af_hash)(sa, &h);
hash = h.afh_hosthash;
mprev = &rthost[hash % RTHASHSIZ];
(*afswitch[af].af_hash)(sa, &h);
hash = h.afh_hosthash;
mprev = &rthost[hash % RTHASHSIZ];