svn commit: r529260 - in head/net: ndpi ndpi/files ntopng ntopng/files
Renato Botelho
garga at FreeBSD.org
Mon Apr 13 21:22:57 UTC 2020
On 13/04/20 17:22, Guido Falsi wrote:
> On 13/04/20 21:48, Renato Botelho wrote:
>> On 13/04/20 15:03, Guido Falsi wrote:
>>> On 13/04/20 19:46, Renato Botelho wrote:
>>>> On 27/03/20 12:21, Guido Falsi wrote:
>>>>> Author: madpilot
>>>>> Date: Fri Mar 27 15:21:15 2020
>>>>> New Revision: 529260
>>>>> URL: https://svnweb.freebsd.org/changeset/ports/529260
>>>>>
>>>>> Log:
>>>>> - Update nDPI to 3.2.d20200324
>>>>> - Update ntopng to 4.0.d20200326
>>>>> Reported by: Victor Hooi <victorhooi at yahoo.com>
>>>>>
>>>>> Deleted:
>>>>> head/net/ntopng/files/patch-scripts_lua_examples_sqlite.lua
>>>>> Modified:
>>>>> head/net/ndpi/Makefile
>>>>> head/net/ndpi/distinfo
>>>>> head/net/ndpi/files/patch-example_Makefile.in
>>>>> head/net/ntopng/Makefile
>>>>> head/net/ntopng/distinfo
>>>>> head/net/ntopng/files/patch-configure.seed
>>>>> head/net/ntopng/pkg-plist
>>>>
>>>> After this change it's failing to build on 12-armv7, at least on
>>>> pfSense
>>>> jails, with following error:
>>>>
>>>> src/ParsedFlow.cpp:130:14: error: invalid operands to binary expression
>>>> ('lua_Number' (aka 'double') and 'double')
>>>> version = htons(lua_tonumber(L, -1));
>>>> ^~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> It's actually right. Maybe on other archs compiler inplicitly casts this
>>> to an int.
>>>
>>> Could you try putting an explicit cast to uint16_t there?
>>
>> Sure, I will try. Also I got a suggestion to replace lua_tonumber() by
>> lua_tointeger(). I can try both and let you know.
>>
>
> I'm not expert about lua, so I did not know there is a lua_tointeger.
> That looks like a cleaner fix, and I can try to upstream that.
I've already opened an Issue upstream [1]. And I confirmed
lua_tointeger() fix the problem, you can find patch attached.
[1] https://github.com/ntop/ntopng/issues/3743
--
Renato Botelho
-------------- next part --------------
--- src/ParsedFlow.cpp.orig 2020-04-13 20:20:29 UTC
+++ src/ParsedFlow.cpp
@@ -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"))
More information about the svn-ports-head
mailing list