[Olsr-dev] Olsrd v0.9.5 and plugin jsoninfo
Ferry Huberts
(spam-protected)
Thu Dec 22 17:13:55 CET 2016
ok, that is clearer.
it appears that just I have not defended against opening a telnet
connection and then doing nothing.
Will check it out later.
On 22/12/16 17:10, Ufo wrote:
> after some more tests with tcpdump:
> starting such a telnet session will stop the device sending olsr-packets
> (tcp698). so olsr is hanging (without a crash)
> typing in "/routes" brings a "403 Forbidden", and olsr-packets were
> reavaken.
>
> or you can wait some minutes, and olsr+plugin-telnet-connection will be
> killed by olsr-watchdog.
>
> On 22.12.2016 16:27, Ufo wrote:
>> Konsole output
>> i also tried to crash olsr. (on LEDE trunk from yesterday) but i think
>> its some kind of hanging-process/deniel-of-service-attack instead of a
>> code-crash.
>> olsr will restart (due to olsr-watchdog) and doesnt have a
>> dump/core-file for gdb for me
>>
>> > Dec 22 14:50:00 2016 user.notice OLSR watchdog: Process died -
>> restarting!
>> > [ 1369.947516] TCP: request_sock_TCP: Possible SYN flooding on port 9090. Sending cookies. Check SNMP
>> counters.
>>
>> problem: a telnet connect to jsonplugin (also from outside of the
>> device) will deny/halt/stop all other jsonplugin-calls. if you then
>> wait too long the olsr-watchdog will cause a olsr-restart. sp2ong,
>> please have a look in dmesg/logread for such messages.
>>
>> at doku (http://www.olsr.org/?q=jsoninfo_plugin) i read
>>
>> "If no address is specified, then localhost (127.0.0.1) is allowed by
>> default."
>>
>> but that doesnt seems to work any more!? On my testdevice there are no
>> PlParams for jsonplugin, BUT i can make telnet/nc connection from
>> outside/other meshnodes. when i ask for "/routes" a message appears
>> "403 Forbidden". the port is open, and one connection to that will
>> block/dos the jsonplugin.
>>
>>
>> mfg ufo
>>
>>
>>
>> On 22.12.2016 09:50, Ferry Huberts wrote:
>>> It all works for me, on Linux with glibc
>>>
>>> I really need a backtrace to be able determine what is going on.
>>> Run olsrd under gdb please to generate a backtrace.
>>>
>>> On 22/12/16 09:47, (spam-protected) wrote:
>>>> I have check similar txtinfo plugin use telnet command and when I have
>>>> request /rou and /lin all information were showed and OLSRD process
>>>> not crash
>>>>
>>>> 2016-12-22 9:44 GMT+01:00 <(spam-protected)>:
>>>>> Hi
>>>>>
>>>>> I know this information about scripts from changelog but I have tray
>>>>> get manually information from jsonplugin use simple unix command
>>>>>
>>>>> echo /routes | nc 127.0.0.0.1 9090
>>>>>
>>>>> where 9090 is port for jsonplugin and when I have ask plugin jsoninfo
>>>>> about 'routes' OLSRD process crash
>>>>>
>>>>> I can do similar use telnet command:
>>>>>
>>>>> telnet 127.0.0.1 9090
>>>>>
>>>>> and when next send command /mid all information is showed but when I
>>>>> have send command in telnet session /routes main OLSRD process crash
>>>>>
>>>>> If I send bad command to jsoninfo I have proper info about invalid
>>>>> requests :
>>>>> telnet 127.0.0.1 9090
>>>>> /lin
>>>>> HTTP/1.1 404 Not Found
>>>>> Date: Thu, 22 Dec 2016 08:39:05 GMT
>>>>> Server: OLSRD JSONINFO
>>>>> Connection: close
>>>>> Content-Type: application/vnd.api+json
>>>>> Access-Control-Allow-Origin: *
>>>>> Access-Control-Allow-Methods: GET, POST, OPTIONS
>>>>> Access-Control-Allow-Headers: Accept, Origin, X-Requested-With
>>>>> Access-Control-Max-Age: 1728000
>>>>> Content-Length: 0
>>>>> Cache-Control: no-cache
>>>>>
>>>>> When I have send correct request like /mid I receive all iformation:
>>>>>
>>>>> telnet 127.0.0.1 9090
>>>>> /mid
>>>>> HTTP/1.1 200 OK
>>>>> Date: Thu, 22 Dec 2016 08:41:24 GMT
>>>>> Server: OLSRD JSONINFO
>>>>> Connection: close
>>>>> Content-Type: application/vnd.api+json
>>>>> Access-Control-Allow-Origin: *
>>>>> Access-Control-Allow-Methods: GET, POST, OPTIONS
>>>>> Access-Control-Allow-Headers: Accept, Origin, X-Requested-With
>>>>> Access-Control-Max-Age: 1728000
>>>>> Content-Length: 465
>>>>> Cache-Control: no-cache
>>>>>
>>>>> {"pid": 27325,"systemTime":
>>>>> .....
>>>>>
>>>>>
>>>>> but when I have try use /links or /routes not inforation and OLSRD
>>>>> stop working and it lis look like crash process because I must again
>>>>> restart olsrd
>>>>>
>>>>> telnet 127.0.0.1 9090
>>>>> /links
>>>>> Connection closed by foreign host
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2016-12-22 9:18 GMT+01:00 Ferry Huberts <(spam-protected)>:
>>>>>>
>>>>>>
>>>>>> On 22/12/16 09:10, (spam-protected) wrote:
>>>>>>> After success compile olsrd 0.9.5 I have update package on my
>>>>>>> openwrt router
>>>>>>> I have use plug-in jsoninfo to get information 'links' and 'routes'
>>>>>>> use following command:
>>>>>>>
>>>>>>> echo /links | nc 127.0.0.1 9090
>>>>>>>
>>>>>>> Now after upgrade to v0.9.5 plugin jsoninfo crash olsrd when I have
>>>>>>
>>>>>> Please provide your commands and the backtrace.
>>>>>>
>>>>>> Also - from the changelog - read this:
>>>>>>
>>>>>> Note: The txtinfo and jsoninfo plugins were 'merged' to use a common
>>>>>> codebase for receiving requests and dispatching replies. Also,
>>>>>> these plugins were subjected to review and fixes. As a result:
>>>>>> - request handling has become much stricter, e.g. a txtinfo
>>>>>> request '/links' will no longer work since the correct
>>>>>> request is
>>>>>> (and has always been) '/lin'.
>>>>>> - some fixes change the format and/or content of txtinfo and/or
>>>>>> jsoninfo output. An example is the txtinfo output of the
>>>>>> request
>>>>>> '/mid' when 'vtime' is enabled on txtinfo; this has been
>>>>>> broken
>>>>>> since the end of 2009 (c555a44).
>>>>>> - invalid requests will return HTTP error status code
>>>>>> "Not Found" (404) when HTTP headers are enabled, and report
>>>>>> an error in the output when they are not enabled.
>>>>>> - requests without output will return HTTP error status code
>>>>>> "No Content" (204) when HTTP headers are enabled, and report
>>>>>> an error in the output when they are not enabled.
>>>>>>
>>>>>> It is VERY strongly advised to check your scripts and
>>>>>> applications
>>>>>> interfacing with olsrd txtinfo and/or jsoninfo before switching
>>>>>> to this version of olsrd.
>>>>>>
>>>>>>
>>>>>>> use check following
>>>>>>> parameters
>>>>>>>
>>>>>>> links
>>>>>>> routes
>>>>>>> topology
>>>>>>> interfaces
>>>>>>>
>>>>>>> when I have check following parameters
>>>>>>>
>>>>>>> hna
>>>>>>> gateways
>>>>>>> mid
>>>>>>> neighbors
>>>>>>> 2hop
>>>>>>> sgw
>>>>>>>
>>>>>>> I have information from jsoninfo and olsrd not crash
>>>>>>>
>>>>>>> I have check olsrd 0.9.5 compiled and running on debian all
>>>>>>> working OK
>>>>>>> but under openwrt
>>>>>>> crash process when I want to get information about links and routes
>>>>>>>
>>>>>>> Anybody have similar problems with olsrd 0.9.5 running under
>>>>>>> openwrt ????
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Waldek
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Ferry Huberts
>>>>>>
>>>
>>
>>
>>
>
>
>
--
Ferry Huberts
More information about the Olsr-dev
mailing list