Pass ip_off and ip_len in the correct byte order to icmp_error(); this
authorangelos <angelos@openbsd.org>
Sun, 9 Apr 2000 17:43:02 +0000 (17:43 +0000)
committerangelos <angelos@openbsd.org>
Sun, 9 Apr 2000 17:43:02 +0000 (17:43 +0000)
should fix the crash problems with isic, reported last week.

sys/netinet/ip_input.c
sys/netinet/udp_usrreq.c

index f4fac0f..0702db5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ip_input.c,v 1.51 2000/04/04 13:43:02 angelos Exp $   */
+/*     $OpenBSD: ip_input.c,v 1.52 2000/04/09 17:43:02 angelos Exp $   */
 /*     $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $   */
 
 /*
@@ -1040,9 +1040,7 @@ ip_dooptions(m)
        return (0);
 bad:
        ip->ip_len -= ip->ip_hl << 2;   /* XXX icmp_error adds in hdr length */
-       HTONS(ip->ip_len);      /* XXX because ip_input changed these three */
        HTONS(ip->ip_id);
-       HTONS(ip->ip_off);
        icmp_error(m, type, code, 0, 0);
        ipstat.ips_badoptions++;
        return (1);
index 5114a17..d82d913 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: udp_usrreq.c,v 1.39 2000/02/18 05:21:01 itojun Exp $  */
+/*     $OpenBSD: udp_usrreq.c,v 1.40 2000/04/09 17:43:02 angelos Exp $ */
 /*     $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
 
 /*
@@ -521,9 +521,7 @@ udp_input(m, va_alist)
 #endif /* INET6 */
                        {
                                *ip = save_ip;
-                               HTONS(ip->ip_len);
                                HTONS(ip->ip_id);
-                               HTONS(ip->ip_off);
                                uh->uh_sum = savesum;
                                icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT,
                                        0, 0);