While testing the kamailio version 4.4.x on FreeBSD I found this in the log. ``` May 4 17:16:26 <local0.warn> voip-integration-cust1 kamailio[1145]: WARNING: <core> [tcp_main.c:2754]: tcp_init(): setsockopt tos: Invalid argument ``` ``` # freebsd-version 10.3-RELEASE ``` ``` version: kamailio 4.4.0 (amd64/freebsd) d4f23c flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_PTHREAD_MUTEX, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, select, kqueue. id: d4f23c compiled on 16:52:24 Apr 30 2016 with clang 3.4 ```
In my config I haven't set **any** TOS
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598
Default value is set to IPTOS_LOWDELAY, this should be defined on bsd -- otherwise should not compile. What version of BSD do you run?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-217099832
I run FreeBSD 10.3-RELEASE.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-217795003
Are you using IPv6? Some searches on the net reveal other projects having same error reported for IP_TOS if the socket is IPv6.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-218105465
yes but only with loopback at the moment
``` #!substdef "/NETWORK_INTERFACE_IPv6/[::1]/" listen=NETWORK_INTERFACE_IPv6:5060 ```
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-218115409
lastest master ``` 0(30442) WARNING: <core> [tcp_main.c:2754]: tcp_init(): setsockopt tos: Invalid argument (16) ``` Then I removed the IPv6 listening and the TOS warning disapared.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-218746566
Thanks for pursuing this. It looks like we need to skip setting this sock option for ipv6.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-218746930
Added setting of IPV6_TCLASS option for IPv6 sockets, the alternative for ipv4 IP_TOS.
If any issue, open a bug for it. The patch will be backported soon.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#issuecomment-222470264
Closed #598.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/598#event-675933815