BSD 4_4_Lite1 release
[unix-history] / usr / src / sys / netinet / udp_usrreq.c
index 32c0529..95b1895 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
- *     Regents of the University of California.  All rights reserved.
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)udp_usrreq.c        8.1 (Berkeley) 6/10/93
+ *     @(#)udp_usrreq.c        8.4 (Berkeley) 1/21/94
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -254,6 +254,10 @@ udp_input(m, iphlen)
        }
        if (inp == 0) {
                udpstat.udps_noport++;
        }
        if (inp == 0) {
                udpstat.udps_noport++;
+               if (m->m_flags & (M_BCAST | M_MCAST)) {
+                       udpstat.udps_noportbcast++;
+                       goto bad;
+               }
                *ip = save_ip;
                ip->ip_len += iphlen;
                icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
                *ip = save_ip;
                ip->ip_len += iphlen;
                icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
@@ -622,9 +626,7 @@ udp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
        void *newp;
        size_t newlen;
 {
        void *newp;
        size_t newlen;
 {
-       extern int ip_ttl;
-
-       /* all sysctl names at this level are terminal */
+       /* All sysctl names at this level are terminal. */
        if (namelen != 1)
                return (ENOTDIR);
 
        if (namelen != 1)
                return (ENOTDIR);