[sr-dev] git:master:c09ede1b: core: different logging for IPv4 and IPv6 for socket option setting

Henning Westerholt hw at gilawa.com
Sun Aug 14 11:02:28 CEST 2022


Module: kamailio
Branch: master
Commit: c09ede1ba7d600da37e7c0007f128a72b34250a4
URL: https://github.com/kamailio/kamailio/commit/c09ede1ba7d600da37e7c0007f128a72b34250a4

Author: Henning Westerholt <hw at gilawa.com>
Committer: Henning Westerholt <hw at gilawa.com>
Date: 2022-08-14T09:01:57Z

core: different logging for IPv4 and IPv6 for socket option setting

---

Modified: src/core/udp_server.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c09ede1ba7d600da37e7c0007f128a72b34250a4.diff
Patch: https://github.com/kamailio/kamailio/commit/c09ede1ba7d600da37e7c0007f128a72b34250a4.patch

---

diff --git a/src/core/udp_server.c b/src/core/udp_server.c
index 1eefb13c42..7c501f0dab 100644
--- a/src/core/udp_server.c
+++ b/src/core/udp_server.c
@@ -336,13 +336,13 @@ int udp_init(struct socket_info* sock_info)
 	if (addr->s.sa_family==AF_INET){
 		if(setsockopt(sock_info->socket, SOL_IP, IP_RECVERR,
 					(void*)&optval, sizeof(optval)) ==-1){
-			LM_ERR("setsockopt: %s\n", strerror(errno));
+			LM_ERR("IPV4 setsockopt: %s\n", strerror(errno));
 			goto error;
 		}
 	} else if (addr->s.sa_family==AF_INET6){
 		if(setsockopt(sock_info->socket, SOL_IPV6, IPV6_RECVERR,
 					(void*)&optval, sizeof(optval)) ==-1){
-			LM_ERR("setsockopt: %s\n", strerror(errno));
+			LM_ERR("IPv6 setsockopt: %s\n", strerror(errno));
 			goto error;
 		}
 	}
@@ -354,7 +354,7 @@ int udp_init(struct socket_info* sock_info)
 		optval= (pmtu_discovery) ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
 		if(setsockopt(sock_info->socket, IPPROTO_IP, IP_MTU_DISCOVER,
 				(void*)&optval, sizeof(optval)) ==-1){
-			LM_ERR("setsockopt: %s\n", strerror(errno));
+			LM_ERR("IPv4 setsockopt: %s\n", strerror(errno));
 			goto error;
 		}
 	} else if (addr->s.sa_family==AF_INET6){
@@ -365,7 +365,7 @@ int udp_init(struct socket_info* sock_info)
 		if(setsockopt(sock_info->socket, IPPROTO_IPV6,
 				IPV6_MTU_DISCOVER,
 				(void*)&optval, sizeof(optval)) ==-1){
-			LM_ERR("setsockopt: %s\n", strerror(errno));
+			LM_ERR("IPv6 setsockopt: %s\n", strerror(errno));
 			goto error;
 		}
 	}




More information about the sr-dev mailing list