Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
radkesvat committed Aug 16, 2024
1 parent 0ef82e2 commit d9dca90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions tunnels/adapters/device/raw/raw_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

enum rawdevice_mode_dynamic_value_status
{
kDvsRead = kDvsFirstOption,
kDvsWrite,
kDvsReadWrite
kDvsWatcher = kDvsFirstOption,
kDvsInjector,
kDvsBoth
};

typedef struct raw_device_state_s
Expand Down Expand Up @@ -133,8 +133,8 @@ tunnel_t *newRawDevice(node_instance_context_t *instance_info)
uint32_t fwmark = 0;
getIntFromJsonObjectOrDefault((int *) &fwmark, settings, "mark", 0);

dynamic_value_t mode = parseDynamicNumericValueFromJsonObject(settings, "mode", 3, "R", "W", "RW");
if ((int) mode.status < kDvsRead)
dynamic_value_t mode = parseDynamicNumericValueFromJsonObject(settings, "mode", 3, "watcher", "injector", "watcher/injector");
if ((int) mode.status < kDvsWatcher)
{
LOGF("JSON Error: RawDevice->settings->mode (string field) : mode is not specified or invalid");
return NULL;
Expand All @@ -148,12 +148,13 @@ tunnel_t *newRawDevice(node_instance_context_t *instance_info)

tunnel_t *t = newTunnel();

if ((int) mode.status == kDvsRead || (int) mode.status == kDvsReadWrite)
if ((int) mode.status == kDvsWatcher || (int) mode.status == kDvsBoth)
{
state->rdev = createRawDevice(state->name, fwmark, t, onIPPacketReceived);
}
else
{
// we are not going to read, so pass read call back as null therfore no buffers for read will be allocated
state->rdev = createRawDevice(state->name, fwmark, t, NULL);
}

Expand Down
6 changes: 3 additions & 3 deletions tunnels/layer3/tcp_manipulator/tcp_manipulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void upStream(tunnel_t *self, context_t *c)

if (WW_UNLIKELY(bufLen(c->payload) < ip_header_len + sizeof(struct tcpheader)))
{
LOGE("TcpManipulator: ipv4 packet too short for TCP header");
LOGW("TcpManipulator: dropped an ipv4 packet, length is too short for TCP header");
reuseContextPayload(c);
destroyContext(c);
return;
Expand All @@ -82,7 +82,7 @@ static void upStream(tunnel_t *self, context_t *c)

if (WW_UNLIKELY(bufLen(c->payload) < ip_header_len + sizeof(struct tcpheader)))
{
LOGE("TcpManipulator: ipv6 packet too short for TCP header");
LOGW("TcpManipulator: dropped an ipv6 packet, length is too short for TCP header");
reuseContextPayload(c);
destroyContext(c);
return;
Expand All @@ -97,7 +97,7 @@ static void upStream(tunnel_t *self, context_t *c)
}
else
{
LOGF("TcpManipulator: non ip packets is assumed to be per filtered by receiver node");
LOGF("TcpManipulator: non ip packets is assumed to be pre-filtered by receiver node");
exit(1);
}

Expand Down

0 comments on commit d9dca90

Please sign in to comment.