[sr-dev] git:master:e5f13086: pv: support INET/6 as alternative IPv4/6 for $K(key)
Daniel-Constantin Mierla
miconda at gmail.com
Wed Jun 9 12:29:04 CEST 2021
Module: kamailio
Branch: master
Commit: e5f130860d909e9a4348db170d4001332e90427e
URL: https://github.com/kamailio/kamailio/commit/e5f130860d909e9a4348db170d4001332e90427e
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-06-09T12:27:57+02:00
pv: support INET/6 as alternative IPv4/6 for $K(key)
- these are the keywords in the config
---
Modified: src/modules/pv/pv_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/e5f130860d909e9a4348db170d4001332e90427e.diff
Patch: https://github.com/kamailio/kamailio/commit/e5f130860d909e9a4348db170d4001332e90427e.patch
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 0af3e640cd..6e70010816 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -3632,6 +3632,7 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
if(strncmp(in->s, "WS", 2)==0)
sp->pvp.pvn.u.isname.name.n = 6;
else goto error;
+ break;
case 3:
if(strncmp(in->s, "UDP", 3)==0)
sp->pvp.pvn.u.isname.name.n = 2;
@@ -3646,12 +3647,19 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
case 4:
if(strncmp(in->s, "IPv4", 4)==0)
sp->pvp.pvn.u.isname.name.n = 0;
+ else if(strncmp(in->s, "INET", 4)==0)
+ sp->pvp.pvn.u.isname.name.n = 0;
else if(strncmp(in->s, "IPv6", 4)==0)
sp->pvp.pvn.u.isname.name.n = 1;
else if(strncmp(in->s, "SCTP", 4)==0)
sp->pvp.pvn.u.isname.name.n = 5;
else goto error;
break;
+ case 5:
+ if(strncmp(in->s, "INET6", 5)==0)
+ sp->pvp.pvn.u.isname.name.n = 1;
+ else goto error;
+ break;
default:
goto error;
}
More information about the sr-dev
mailing list