[sr-dev] git:master:f461081a: core: dns cache - catch unknown record type to avoid compile warnings

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 30 10:12:57 CEST 2017


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-06-30T10:11:50+02:00

core: dns cache - catch unknown record type to avoid compile warnings

---

Modified: src/core/dns_cache.c

---

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

---

diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c
index 39bed3d315..3b0f5404c4 100644
--- a/src/core/dns_cache.c
+++ b/src/core/dns_cache.c
@@ -2402,6 +2402,10 @@ inline static struct hostent* dns_entry2he(struct dns_hash_entry* e)
 					case T_AAAA:
 						ip = ((struct aaaa_rdata*)rr->rdata)->ip6;
 						break;
+					default:
+						LM_CRIT("wrong entry type %d for %.*s\n",
+							e->type, e->name_len, e->name);
+						return 0;
 				}
 				memcpy(p_addr[i], ip, len);
 	}




More information about the sr-dev mailing list