try to integrate options fixes in 7.10 into network release
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 18 Feb 1989 01:05:34 +0000 (17:05 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 18 Feb 1989 01:05:34 +0000 (17:05 -0800)
SCCS-vsn: sys/netinet/ip_icmp.c 7.8.1.1

usr/src/sys/netinet/ip_icmp.c

index d5e2a0b..3689f8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1982, 1986 Regents of the University of California.
+ * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)ip_icmp.c   7.10 (Berkeley) %G%
+ *     @(#)ip_icmp.c   7.8.1.1 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -75,6 +75,7 @@ icmp_error(n, type, code, dest)
        if (oip->ip_off &~ (IP_MF|IP_DF))
                goto free;
        if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
        if (oip->ip_off &~ (IP_MF|IP_DF))
                goto free;
        if (oip->ip_p == IPPROTO_ICMP && type != ICMP_REDIRECT &&
+         dtom(oip)->m_len >= oiplen + ICMP_MINLEN &&
          n->m_len >= oiplen + ICMP_MINLEN &&
          !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
                icmpstat.icps_oldicmp++;
          n->m_len >= oiplen + ICMP_MINLEN &&
          !ICMP_INFOTYPE(((struct icmp *)((caddr_t)oip + oiplen))->icmp_type)) {
                icmpstat.icps_oldicmp++;
@@ -122,6 +123,7 @@ icmp_error(n, type, code, dest)
        bcopy((caddr_t)oip, (caddr_t)nip, oiplen);
        nip->ip_len = m->m_len;
        nip->ip_hl = sizeof(struct ip) >> 2;
        bcopy((caddr_t)oip, (caddr_t)nip, oiplen);
        nip->ip_len = m->m_len;
        nip->ip_hl = sizeof(struct ip) >> 2;
+       nip->ip_hl = sizeof(struct ip) >> 2;
        nip->ip_p = IPPROTO_ICMP;
        icmp_reflect(m);
 
        nip->ip_p = IPPROTO_ICMP;
        icmp_reflect(m);
 
@@ -386,6 +388,10 @@ icmp_reflect(m)
                int opt, cnt, off;
                u_int len;
 
                int opt, cnt, off;
                u_int len;
 
+               register u_char *cp;
+               int opt, cnt, off;
+               u_int len;
+
                /*
                 * Retrieve any source routing from the incoming packet;
                 * add on any record-route or timestamp options.
                /*
                 * Retrieve any source routing from the incoming packet;
                 * add on any record-route or timestamp options.