Ticket #6166: 0004-Wire-up-net_stack_cleanup.patch

File 0004-Wire-up-net_stack_cleanup.patch, 1.1 KB (added by jessicah, 10 years ago)

proposed patch: wire up net_stack_cleanup()

  • src/system/boot/loader/main.cpp

    From a17b68dad4f461b36f3cb6cd9d3787acec14af7a Mon Sep 17 00:00:00 2001
    From: Andreas Faerber <andreas.faerber@web.de>
    Date: Sun, 13 Jun 2010 17:00:45 +0200
    Subject: [PATCH 4/4] Wire up net_stack_cleanup()
    
    The NetStack.h header is currently not usable from C code. So while
    net_stack_init() is called from platform code, we cannot call
    net_stack_cleanup() from OpenFirmware's platform_start_kernel().
    Thus call it directly from main()'s cleanup TODO, having assured
    that the function is a no-op when no network stack was initialized.
    ---
     src/system/boot/loader/main.cpp |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp
    index db23ea9..d198d8f 100644
    a b  
    1313#include <boot/platform.h>
    1414#include <boot/heap.h>
    1515#include <boot/PathBlacklist.h>
    1616#include <boot/stdio.h>
     17#include <boot/net/NetStack.h>
    1718
    main(stage2_args *args)  
    144145
     146            net_stack_cleanup();
    145147            // ToDo: cleanup, heap_release() etc.
    146148            heap_print_statistics();
    147149            platform_start_kernel();
    148150        }