provide correct exit values
[unix-history] / usr / src / sbin / routed / af.c
index 67d273e..ed21864 100644 (file)
@@ -1,12 +1,23 @@
 /*
  * Copyright (c) 1983 Regents of the University of California.
 /*
  * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)af.c       5.4 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)af.c       5.8 (Berkeley) %G%";
+#endif /* not lint */
 
 #include "defs.h"
 
 
 #include "defs.h"
 
@@ -15,14 +26,14 @@ static char sccsid[] = "@(#)af.c    5.4 (Berkeley) %G%";
  */
 int    inet_hash(), inet_netmatch(), inet_output(),
        inet_portmatch(), inet_portcheck(),
  */
 int    inet_hash(), inet_netmatch(), inet_output(),
        inet_portmatch(), inet_portcheck(),
-       inet_checkhost(), inet_rtflags(), inet_sendsubnet(), inet_canon();
+       inet_checkhost(), inet_rtflags(), inet_sendroute(), inet_canon();
 char   *inet_format();
 
 #define NIL    { 0 }
 #define        INET \
        { inet_hash,            inet_netmatch,          inet_output, \
          inet_portmatch,       inet_portcheck,         inet_checkhost, \
 char   *inet_format();
 
 #define NIL    { 0 }
 #define        INET \
        { inet_hash,            inet_netmatch,          inet_output, \
          inet_portmatch,       inet_portcheck,         inet_checkhost, \
-         inet_rtflags,         inet_sendsubnet,        inet_canon, \
+         inet_rtflags,         inet_sendroute,         inet_canon, \
          inet_format \
        }
 
          inet_format \
        }
 
@@ -105,9 +116,11 @@ inet_checkhost(sin)
 {
        u_long i = ntohl(sin->sin_addr.s_addr);
 
 {
        u_long i = ntohl(sin->sin_addr.s_addr);
 
-#define        IN_BADCLASS(i)  (((long) (i) & 0xe0000000) == 0xe0000000)
+#ifndef IN_EXPERIMENTAL
+#define        IN_EXPERIMENTAL(i)      (((long) (i) & 0xe0000000) == 0xe0000000)
+#endif
 
 
-       if (IN_BADCLASS(i) || sin->sin_port != 0)
+       if (IN_EXPERIMENTAL(i) || sin->sin_port != 0)
                return (0);
        if (i != 0 && (i & 0xff000000) == 0)
                return (0);
                return (0);
        if (i != 0 && (i & 0xff000000) == 0)
                return (0);