Fixes for DLEP router UDP mode v0.15.1
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Mon, 19 Mar 2018 06:55:56 +0000 (07:55 +0100)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Mon, 19 Mar 2018 06:55:56 +0000 (07:55 +0100)
src-plugins/generic/dlep/router/dlep_router.c
src-plugins/generic/dlep/router/dlep_router_interface.c

index fa864cf..aa24c22 100644 (file)
@@ -110,7 +110,7 @@ static struct cfg_schema_entry _router_entries[] = {
 
   CFG_MAP_NETADDR_V46(dlep_router_if, connect_to_addr, "connect_to", "-",
     "IP to directly connect to a known DLEP radio TCP socket", false, true),
-  CFG_MAP_INT32_MINMAX(dlep_router_if, connect_to_port, "connect_to_port", "1",
+  CFG_MAP_INT32_MINMAX(dlep_router_if, connect_to_port, "connect_to_port", DLEP_WELL_KNOWN_SESSION_PORT_TXT,
     "TCP port to directly connect to a known DLEP radio TCP socket", 0, 1, 65535),
 };
 
index 236cb81..ef406e3 100644 (file)
@@ -331,8 +331,9 @@ _check_connect_to(struct dlep_router_if *router_if) {
   }
 
   connect_to_session = dlep_router_get_session(router_if, &router_if->connect_to);
-  if (connect_to_session->session._peer_state == DLEP_PEER_NOT_CONNECTED
-    || connect_to_session->session._peer_state == DLEP_PEER_TERMINATED) {
+  if (connect_to_session != NULL
+    && (connect_to_session->session._peer_state == DLEP_PEER_NOT_CONNECTED
+    || connect_to_session->session._peer_state == DLEP_PEER_TERMINATED)) {
     /* cleanup not working session */
     dlep_router_remove_session(connect_to_session);
     connect_to_session = NULL;