mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-22 02:38:59 +00:00
htons(3) expect an unsigned integer as input, so lua_tointeger() looks more appropriate there.
Not sure why on FreeBSD armv7 it's causing an error, my best guess is that certain compiler/arch combinations refuse tu implicitly cast float to unsigned int. Problem and patch reported and proposed by @rbgarga This should fix #3743
This commit is contained in:
parent
e77486c7d9
commit
011eb77d4e
1 changed files with 5 additions and 5 deletions
|
|
@ -127,17 +127,17 @@ void ParsedFlow::fromLua(lua_State *L, int index) {
|
|||
if(!strcmp(key, "vlan_id"))
|
||||
vlan_id = lua_tonumber(L, -1);
|
||||
else if(!strcmp(key, "version"))
|
||||
version = htons(lua_tonumber(L, -1));
|
||||
version = htons(lua_tointeger(L, -1));
|
||||
else if(!strcmp(key, "src_port"))
|
||||
src_port = htons(lua_tonumber(L, -1));
|
||||
src_port = htons(lua_tointeger(L, -1));
|
||||
else if(!strcmp(key, "dst_port"))
|
||||
dst_port = htons(lua_tonumber(L, -1));
|
||||
dst_port = htons(lua_tointeger(L, -1));
|
||||
else if(!strcmp(key, "l4_proto"))
|
||||
l4_proto = lua_tonumber(L, -1);
|
||||
else if(!strcmp(key, "tcp_flags"))
|
||||
tcp.tcp_flags = htons(lua_tonumber(L, -1));
|
||||
tcp.tcp_flags = htons(lua_tointeger(L, -1));
|
||||
else if(!strcmp(key, "direction"))
|
||||
direction = htons(lua_tonumber(L, -1));
|
||||
direction = htons(lua_tointeger(L, -1));
|
||||
else if(!strcmp(key, "first_switched"))
|
||||
first_switched = lua_tonumber(L, -1);
|
||||
else if(!strcmp(key, "last_switched"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue