[syslog-ng] TOS value updating from afinet_setup_socket

Scheidler, Balázs balazs.scheidler at balabit.com
Fri Jun 12 10:02:56 CEST 2015


I am looking at the latest master, and I did confirm that TTL setup (that
happens in the same function) is being performed. So either it is broken in
your version or you miss something. Try setting the TTL value and check if
it is being executed.


-- 
Bazsi

On Thu, Jun 11, 2015 at 6:04 PM, Dilip Basavaraju <
DILIP.KUMARB at lnttechservices.com> wrote:

>  Code is compiling and running properly. #ifs is defined by me
>
> Sent from my iPhone
>
> On 11-Jun-2015, at 8:47 pm, Scheidler, Balázs <
> balazs.scheidler at balabit.com> wrote:
>
>   Your #ifs refer to kernel defines, which are not definted in the
> syslog-ng source. at least it looks that way.
>
>
>  --
> Bazsi
>
> On Thu, Jun 11, 2015 at 4:02 PM, Dilip Basavaraju <
> DILIP.KUMARB at lnttechservices.com> wrote:
>
>>  Dear All,
>>
>>
>>
>>                 I am facing issue in updating TOS value using setsockopt
>> in the function afinet_setup_socket.
>>
>>
>>
>>                 //syslog_ng_dscp_val = 40;
>>
>>
>>
>>
>>
>>                 setsockopt(fd, SOL_IP, IP_TOS, &syslog_ng_dscp_val,
>> sizeof(syslog_ng_dscp_val));
>>
>> below is the function definition.
>>
>>
>>
>> I am not getting any print messages. I think this function is not being
>> called. Please suggest me how to update the TOS value.
>>
>>
>>
>> I am waiting for your responses please.
>>
>>
>>
>> static gboolean
>>
>> afinet_setup_socket(gint fd, GSockAddr *addr, InetSocketOptions
>> *sock_options, AFSocketDirection dir)
>>
>> {
>>
>>   gint off = 0;
>>
>>
>>
>>   if (!afsocket_setup_socket(fd, &sock_options->super, dir))
>>
>>     return FALSE;
>>
>>
>>
>>   switch (addr->sa.sa_family)
>>
>>     {
>>
>>     case AF_INET:
>>
>>      {
>>
>>         struct ip_mreq mreq;
>>
>>             if (dir & AFSOCKET_DIR_RECV)
>>
>>               {
>>
>>                 memset(&mreq, 0, sizeof(mreq));
>>
>>                 setsockopt(fd, SOL_IP, IP_ADD_MEMBERSHIP, &mreq,
>> sizeof(mreq));
>>
>>             if (dir & AFSOCKET_DIR_SEND)
>>
>>                         setsockopt(fd, SOL_IP, IP_MULTICAST_TTL,
>> &sock_options->ttl, sizeof(sock_options->ttl));
>>
>>               }
>>
>>         else
>>
>>         {
>>
>>                 if (sock_options->ttl && (dir & AFSOCKET_DIR_SEND))
>>
>>                         setsockopt(fd, SOL_IP, IP_TTL,
>> &sock_options->ttl, sizeof(sock_options->ttl));
>>
>>         }
>>
>> #if CONFIG_CP_DSCP
>>
>>         //setsockopt(fd, SOL_IP, IP_TOS, &syslog_ng_dscp_val,
>> sizeof(syslog_ng_dscp_val));
>>
>>         int tmpSouravVal = 40;          //dilipu
>>
>>         setsockopt(fd, SOL_IP, IP_TOS, &tmpSouravVal,
>> sizeof(syslog_ng_dscp_val));
>>
>> #if (CONFIG_CP_IPV6 && CONFIG_CP_DSCP)
>>
>>         setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &syslog_ng_dscp_val,
>> sizeof(syslog_ng_dscp_val));
>>
>> #endif
>>
>> #else
>>
>>
>>
>>         if (sock_options->tos && (dir & AFSOCKET_DIR_SEND))
>>
>>                 setsockopt(fd, SOL_IP, IP_TOS, &sock_options->tos,
>> sizeof(sock_options->tos));
>>
>> #endif
>>
>>         break;
>>
>>       }
>>
>>     }
>>
>>   return TRUE;
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>> Thanks and regards
>>
>> Dilip Kumar B
>>
>> *L&T Technology Services Ltd*
>>
>> www.LntTechservices.com <http://www.lnttechservices.com/>
>>
>> This Email may contain confidential or privileged information for the
>> intended recipient (s). If you are not the intended recipient, please do
>> not use or disseminate the information, notify the sender and delete it
>> from your system.
>>
>>
>> ______________________________________________________________________________
>> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Documentation:
>> http://www.balabit.com/support/documentation/?product=syslog-ng
>> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>>
>>
>>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>   *L&T Technology Services Ltd*
>
> www.LntTechservices.com <http://www.lnttechservices.com/>
>
> This Email may contain confidential or privileged information for the
> intended recipient (s). If you are not the intended recipient, please do
> not use or disseminate the information, notify the sender and delete it
> from your system.
>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20150612/9c307b4c/attachment-0001.htm 


More information about the syslog-ng mailing list