Skip to content

Commit

Permalink
Update the manpages, finally
Browse files Browse the repository at this point in the history
Also: I noticed that pool6 wasn't being properly validated during
instance adds. It's fixed now.
  • Loading branch information
ydahhrk committed Jan 17, 2019
1 parent 798d2e1 commit b807a6a
Show file tree
Hide file tree
Showing 14 changed files with 438 additions and 301 deletions.
4 changes: 2 additions & 2 deletions src/mod/common/common-global.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ int validate_pool6(struct global_field *field, void *value, bool force)
if (!prefix->set)
return 0;

error = validate_pool6_len(prefix->prefix.len);
error = prefix6_validate(&prefix->prefix);
if (error)
return error;

error = prefix6_validate(&prefix->prefix);
error = validate_pool6_len(prefix->prefix.len);
if (error)
return error;

Expand Down
11 changes: 8 additions & 3 deletions src/mod/common/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "common/config.h"
#include "common/constants.h"
#include "common/types.h"
#include "mod/common/common-global.h"
#include "mod/common/tags.h"
#include "mod/common/wkmalloc.h"

Expand All @@ -13,9 +14,13 @@ static DEFINE_MUTEX(lock);
RCUTAG_USR
struct global_config *config_alloc(struct config_prefix6 *pool6)
{
static const __u16 PLATEAUS[] = DEFAULT_MTU_PLATEAUS;
struct global_config *result;
struct globals *config;
__u16 plateaus[] = DEFAULT_MTU_PLATEAUS;

/* TODO force, return error code, more elegant NULL management */
if (pool6 && validate_pool6(NULL, pool6, true))
return NULL;

result = wkmalloc(struct global_config, GFP_KERNEL);
if (!result)
Expand All @@ -32,8 +37,8 @@ struct global_config *config_alloc(struct config_prefix6 *pool6)
config->reset_traffic_class = DEFAULT_RESET_TRAFFIC_CLASS;
config->reset_tos = DEFAULT_RESET_TOS;
config->new_tos = DEFAULT_NEW_TOS;
memcpy(config->plateaus.values, &plateaus, sizeof(plateaus));
config->plateaus.count = ARRAY_SIZE(plateaus);
memcpy(config->plateaus.values, &PLATEAUS, sizeof(PLATEAUS));
config->plateaus.count = ARRAY_SIZE(PLATEAUS);

if (xlat_is_siit()) {
config->siit.compute_udp_csum_zero = DEFAULT_COMPUTE_UDP_CSUM0;
Expand Down
1 change: 1 addition & 0 deletions src/mod/common/kernel_hook_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ static unsigned int verdict2netfilter(verdict result)
case VERDICT_STOLEN:
return NF_STOLEN; /* This is the happy path. */
case VERDICT_UNTRANSLATABLE:
/* TODO do not output this before having found the instance. */
log_debug("Returning the packet to the kernel.");
return NF_ACCEPT;
case VERDICT_DROP:
Expand Down
Loading

0 comments on commit b807a6a

Please sign in to comment.