+/*
+ * If we have an interface to the wide, wide world,
+ * add an entry for an Internet default route (wildcard) to the internal
+ * tables and advertise it. This route is not added to the kernel routes,
+ * but this entry prevents us from listening to other people's defaults
+ * and installing them in the kernel here.
+ */
+rtdefault()
+{
+ struct afhash h;
+ register struct rt_entry *rt;
+ struct rthash *rh;
+ extern struct sockaddr inet_default;
+
+ rt = (struct rt_entry *)malloc(sizeof (*rt));
+ if (rt == 0)
+ return;
+ rt->rt_hash = h.afh_nethash;
+ rt->rt_dst = inet_default;
+ rt->rt_router = rt->rt_dst;
+ (*afswitch[AF_INET].af_hash)(&rt->rt_dst, &h);
+ rh = &nethash[h.afh_nethash % ROUTEHASHSIZ];
+ rt->rt_metric = 0;
+ rt->rt_timer = 0;
+ rt->rt_flags = RTF_UP | RTF_GATEWAY;
+ rt->rt_state = RTS_CHANGED | RTS_PASSIVE;
+ rt->rt_ifp = 0;
+ insque(rt, rh);
+ TRACE_ACTION(ADD, rt);
+}
+