1824802fb2
ndhc will fork off an ifchd child that it will communicate with via pipes rather than by connecting to a SO_PEERCRED AF_UNIX socket. The advantages include: 1. Simpler configuration. Much easier for users and packagers to set up. 2. Drastically less complex code for the ifch functionality. More code is removed than added, and the result is a lot less complex. 3. Potentially better security. The ifch can only service the parent ndhc process, and it is restricted to issuing modifications to the single interface that ndhc manages. 4. Less memory used on systems that allow overcommit. The downsides: 1. Possibly more memory used on systems that run multiple ndhcs and use strict commit limits. At the same time, use netlink rather than ioctls so that the interface ip, subnet, and broadcast address can be set simultaneously. This change reduces the netlink notification spam greatly. The current code builds but isn't yet complete. Subsequent commits will flesh things out and polish out some remaining issues.
23 lines
569 B
CMake
23 lines
569 B
CMake
project (ndhc)
|
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
include_directories("${PROJECT_SOURCE_DIR}")
|
|
|
|
set(RAGEL_IFCHD_PARSE ${CMAKE_CURRENT_BINARY_DIR}/ifchd-parse.c)
|
|
|
|
find_program(RAGEL ragel)
|
|
add_custom_command(
|
|
OUTPUT ${RAGEL_IFCHD_PARSE}
|
|
COMMAND ${RAGEL} -G2 -o ${RAGEL_IFCHD_PARSE} ifchd-parse.rl
|
|
DEPENDS ifchd-parse.rl
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
COMMENT "Compiling Ragel state machine: ifchd-parse.rl"
|
|
VERBATIM
|
|
)
|
|
|
|
file(GLOB NDHC_SRCS "*.c")
|
|
|
|
add_executable(ndhc ${RAGEL_IFCHD_PARSE} ${NDHC_SRCS})
|
|
target_link_libraries(ndhc ncmlib)
|