Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet From FreeBSD (1.164) courtesy of Maxim Konovalov:
details: https://anonhg.NetBSD.org/src/rev/453072153abd
branches: trunk
changeset: 536506:453072153abd
user: darrenr <darrenr%NetBSD.org@localhost>
date: Tue Sep 17 13:10:59 2002 +0000
description:
>From FreeBSD (1.164) courtesy of Maxim Konovalov:
"In rare cases when there is no room for ip options ip_insertoptions()
can fail and corrupt a header length. Initialize len and check what
ip_insertoptions() returns."
diffstat:
sys/netinet/ip_output.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r cb4d40ca18b2 -r 453072153abd sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c Tue Sep 17 08:14:22 2002 +0000
+++ b/sys/netinet/ip_output.c Tue Sep 17 13:10:59 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_output.c,v 1.101 2002/09/11 02:46:43 itojun Exp $ */
+/* $NetBSD: ip_output.c,v 1.102 2002/09/17 13:10:59 darrenr Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.101 2002/09/11 02:46:43 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.102 2002/09/17 13:10:59 darrenr Exp $");
#include "opt_pfil_hooks.h"
#include "opt_ipsec.h"
@@ -186,6 +186,7 @@
#endif /*IPSEC*/
u_int16_t ip_len;
+ len = 0;
va_start(ap, m0);
opt = va_arg(ap, struct mbuf *);
ro = va_arg(ap, struct route *);
@@ -208,7 +209,8 @@
#endif
if (opt) {
m = ip_insertoptions(m, opt, &len);
- hlen = len;
+ if (len >= sizeof(struct ip))
+ hlen = len;
}
ip = mtod(m, struct ip *);
/*
Home |
Main Index |
Thread Index |
Old Index