Browse code

pv: support INET/6 as alternative IPv4/6 for $K(key)

- these are the keywords in the config

Daniel-Constantin Mierla authored on 09/06/2021 10:27:57
Showing 1 changed files
... ...
@@ -3632,6 +3632,7 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3632 3632
 			if(strncmp(in->s, "WS", 2)==0)
3633 3633
 				sp->pvp.pvn.u.isname.name.n = 6;
3634 3634
 			else goto error;
3635
+		break;
3635 3636
 		case 3:
3636 3637
 			if(strncmp(in->s, "UDP", 3)==0)
3637 3638
 				sp->pvp.pvn.u.isname.name.n = 2;
... ...
@@ -3646,12 +3647,19 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3646 3647
 		case 4:
3647 3648
 			if(strncmp(in->s, "IPv4", 4)==0)
3648 3649
 				sp->pvp.pvn.u.isname.name.n = 0;
3650
+			else if(strncmp(in->s, "INET", 4)==0)
3651
+				sp->pvp.pvn.u.isname.name.n = 0;
3649 3652
 			else if(strncmp(in->s, "IPv6", 4)==0)
3650 3653
 				sp->pvp.pvn.u.isname.name.n = 1;
3651 3654
 			else if(strncmp(in->s, "SCTP", 4)==0)
3652 3655
 				sp->pvp.pvn.u.isname.name.n = 5;
3653 3656
 			else goto error;
3654 3657
 		break;
3658
+		case 5:
3659
+			if(strncmp(in->s, "INET6", 5)==0)
3660
+				sp->pvp.pvn.u.isname.name.n = 1;
3661
+			else goto error;
3662
+		break;
3655 3663
 		default:
3656 3664
 			goto error;
3657 3665
 	}