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

[tyndur-devel] [PATCH] tcpip: Pagefault beim Hinzufuegen neuer Routen



! tcpip: Wenn eine neue Route angegeben wird, muss sie auch erstmal
  angelegt werden, sonst ist sie ziemlich NULL

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/modules/tcpip/lostio_if.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/modules/tcpip/lostio_if.c b/src/modules/tcpip/lostio_if.c
index e4ebe57..32fdf44 100644
--- a/src/modules/tcpip/lostio_if.c
+++ b/src/modules/tcpip/lostio_if.c
@@ -501,6 +501,12 @@ int lostio_route_close(lostio_filehandle_t *handle)
         if (failed == FALSE)
         {
             struct routing_entry *entry = enum_routing_entry(0);
+
+            if (entry == NULL) {
+                entry = calloc(1, sizeof(*entry));
+                add_routing_entry(entry);
+            }
+
             entry->target = ips[0];
             entry->gateway = ips[1];
             entry->subnet = ips[2];
-- 
1.6.0.2