<div dir="ltr">Hi Tusa,<div><br></div><div>Compiled successfully with the addition of:</div><div><div>#include <stdint.h><br></div><div><br></div><div> g_sockaddr_set_port(conn->remote_sa, (uint16_t) port);</div></div><div><br></div><div>Now it seems my stomp server needs some credentials :-)</div><div><br></div><div>BR,</div><div>Ole</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 30, 2015 at 12:25 AM, Tusa Viktor <span dir="ltr"><<a href="mailto:tusavik@gmail.com" target="_blank">tusavik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi Ole!<br><br>You are totally right, this is a bug in afstomp module. There is a missing g_sockaddr_set_port() call in stomp.c. I can create a patch for you at the weekend, or you can patch it manually by inserting the line:<br></div>g_sockaddr_set_port(conn->remote_sa, (uint16) port); into modules/afstomp/stomp.c in line 118.<br><br></div><div>Thanks for the detailed bug report!<br></div><div><br></div>HtH,<br></div>Viktor<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Jan 29, 2015 at 6:39 PM, Ole Jørgensen <span dir="ltr"><<a href="mailto:oleide@gmail.com" target="_blank">oleide@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<div><br></div><div>I'm testing the stomp destination using syslog-ng ose 3.6.2, and as the process starts it logs:</div><div><div># /opt/syslog-ng-3.6.2/sbin/syslog-ng -f /opt/syslog-ng-3.6.2/etc/syslog-ng.conf -F -d -v -t 2>&1 | grep -i stomp</div><div>[2015-01-29T18:29:45.323518] Reading shared object for a candidate module; path='/opt/syslog-ng-3.6.2/lib/syslog-ng', fname='afstomp.so', module='afstomp'</div><div>[2015-01-29T18:29:45.323629] Registering candidate plugin; module='afstomp', context='destination', name='stomp', preference='0'</div><div>[2015-01-29T18:29:45.343833] Module loaded and initialized successfully; module='afstomp'</div><div>[2015-01-29T18:29:45.344725] Compiling d_stomp reference [destination] at [/opt/syslog-ng-3.6.2/etc/syslog-ng.conf:70:2]</div><div>[2015-01-29T18:29:45.344728] Compiling d_stomp sequence [destination] at [/opt/syslog-ng-3.6.2/etc/syslog-ng.conf:32:1]</div><div>[2015-01-29T18:29:45.345092] Initializing STOMP destination; host='localhost', port='61613', destination='/topic/syslog'</div><div>[2015-01-29T18:29:45.345368] Worker thread started; driver='d_stomp#0'</div><div>[2015-01-29T18:29:45.346854] Stomp connection failed; host='localhost'</div><div><br></div><div>Relevant parts of my configuration:</div><div>destination d_stomp {<br></div><div><div> stomp(</div><div> host("localhost")</div><div> port(61613)</div><div> body("testing")</div><div> ack(yes)</div><div> retries(9)</div><div> value-pairs(scope(everything))</div></div><div> );<br></div><div>};</div><div><br></div><div>The strange thing is that when I'm starting syslog-ng I am running tcpdump -i lo -s0 -nn -v port 61613, and cannot see any packets. I would expect at least a syn connection since it claims to fail. SELinux does not log any denies during the startup, so I suspect the problem to be elsewhere.</div><div><br></div><div>If i do a tcpdump -i lo -s0 -nn -v -X and start syslog-ng this is captured:</div><div><div>18:33:26.833330 IP (tos 0x0, ttl 64, id 5652, offset 0, flags [DF], proto TCP (6), length 60)</div><div> 127.0.0.1.35340 > 127.0.0.1.0: Flags [S], cksum 0xd601 (correct), seq 801587243, win 65495, options [mss 65495,sackOK,TS val 700601919 ecr 0,nop,wscale 7], length 0</div><div> 0x0000: 4500 003c 1614 4000 4006 26a6 7f00 0001 E..<..@.@.&.....</div><div> 0x0010: 7f00 0001 8a0c 0000 2fc7 402b 0000 0000 ......../.@+....</div><div> 0x0020: a002 ffd7 d601 0000 0204 ffd7 0402 080a ................</div><div> 0x0030: 29c2 563f 0000 0000 0103 0307 ).V?........</div><div>18:33:26.833412 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 40)</div><div> 127.0.0.1.0 > 127.0.0.1.35340: Flags [R.], cksum 0xb7ce (correct), seq 0, ack 801587244, win 0, length 0</div><div> 0x0000: 4500 0028 0000 4000 4006 3cce 7f00 0001 E..(..@.@.<.....</div><div> 0x0010: 7f00 0001 0000 8a0c 0000 0000 2fc7 402c ............/.@,</div><div> 0x0020: 5014 0000 b7ce 0000 P.......</div></div><div><br></div><div>So we get a syn to port 0 and answer with reset. Could there be a port parsing error for stomp in syslog-ng OSE 3.6.2? Any suggestions?</div><div><br></div><div>Also: syslog-ng spawns another thread to do the stomp connection, any suggestions on how I can strace this thread during startup to see what is actually going on? Would love to know if in fact this connection is made to port 0.</div><div><br></div><div>Thanks,</div><div>Ole</div></div></div>
<br></div></div>______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
<br></blockquote></div><br></div>
<br>______________________________________________________________________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/support/documentation/?product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a><br>
<br>
<br></blockquote></div><br></div>