Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipreassembler header issue #417

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions elements/ip/ipreassembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ IPReassembler::simple_action(Packet *p)
q->set_anno_u16(_mtu_anno, p->network_length());

// extend the packet if necessary
if (p_lastoff > q->transport_length()) {
if (p_lastoff + 8 > q->transport_length()) {
// error if packet already completed
if (!(q->ip_header()->ip_off & htons(IP_MF))) {
p->kill();
Expand Down Expand Up @@ -375,7 +375,7 @@ IPReassembler::simple_action(Packet *p)
// copy p's annotations and IP header if it is the first packet
if (p_off == 0) {
uint16_t old_ip_off = q->ip_header()->ip_off;
int header_delta = p->ip_header_offset() - q->ip_header_offset();
int header_delta = p->ip_header_offset() - q->ip_header_offset() + p->ip_header_length() - q->ip_header_length();
if (header_delta > 0)
q = q->push(header_delta);
else if (header_delta < 0)
Expand Down
2 changes: 1 addition & 1 deletion elements/ip/ipreassembler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class IPReassembler : public Element { public:
struct ChunkLink {
uint16_t off;
uint16_t lastoff;
};
} __attribute__((packed));

private:

Expand Down
2 changes: 1 addition & 1 deletion lib/ip6address.cc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ IP6AddressArg::basic_parse(const String &str, IP6Address &result, const ArgConte
int d = 0, p = 0, coloncolon = -1;

const char *begin = str.begin(), *end = str.end(), *s;
for (s = begin; s != end; ++s) {
for (s = begin; s != end && d < 8; ++s) {
int digit;
if (*s >= '0' && *s <= '9')
digit = *s - '0';
Expand Down
2 changes: 1 addition & 1 deletion lib/lexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Lexer::Compound::expand_into(Lexer *lexer, int which, VariableEnvironment &ve)

// now copy hookups
for (const Connection *cp = _conn.begin(); cp != _conn.end(); ++cp)
if (eidx_map[(*cp)[0].idx] >= 0 && eidx_map[(*cp)[0].idx] >= 0)
if (eidx_map[(*cp)[0].idx] >= 0 && eidx_map[(*cp)[1].idx] >= 0)
lexer->_c->connect(eidx_map[(*cp)[1].idx], (*cp)[1].port,
eidx_map[(*cp)[0].idx], (*cp)[0].port);

Expand Down