Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 ip6_output: check for rtcache_setdst() error, w...



details:   https://anonhg.NetBSD.org/src/rev/6c6f35cc2bc9
branches:  trunk
changeset: 773529:6c6f35cc2bc9
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Feb 05 00:41:15 2012 +0000

description:
ip6_output: check for rtcache_setdst() error, which may happen if running
out of memory.

diffstat:

 sys/netinet6/ip6_output.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 375c9eb3c781 -r 6c6f35cc2bc9 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Sun Feb 05 00:37:13 2012 +0000
+++ b/sys/netinet6/ip6_output.c Sun Feb 05 00:41:15 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_output.c,v 1.144 2012/01/10 20:05:37 drochner Exp $        */
+/*     $NetBSD: ip6_output.c,v 1.145 2012/02/05 00:41:15 rmind Exp $   */
 /*     $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $    */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.144 2012/01/10 20:05:37 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_output.c,v 1.145 2012/02/05 00:41:15 rmind Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -677,7 +677,10 @@
                 * If in6_selectroute() does not return a route entry,
                 * dst may not have been updated.
                 */
-               rtcache_setdst(ro, sin6tosa(&dst_sa));
+               error = rtcache_setdst(ro, sin6tosa(&dst_sa));
+               if (error) {
+                       goto bad;
+               }
        }
 
        /*



Home | Main Index | Thread Index | Old Index