Skip to content

Commit 52d56f4

Browse files
committed
Fix no gateway case in IPSECKEY RR
1 parent ad75d85 commit 52d56f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/generic/types.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,10 @@ static int32_t parse_ipseckey_rdata(
15241524
return code;
15251525

15261526
switch (octets[1]) {
1527+
case 0: /* no gateway */
1528+
if (token->length != 1 || token->data[0] != '.')
1529+
SYNTAX_ERROR(parser, "Invalid %s in %s", NAME(&fields[3]), NAME(type));
1530+
break;
15271531
case 1: /* IPv4 address */
15281532
type = (const type_info_t *)ipseckey_ipv4;
15291533
fields = type->rdata.fields;
@@ -1536,7 +1540,6 @@ static int32_t parse_ipseckey_rdata(
15361540
if ((code = parse_ip6(parser, type, &fields[3], rdata, token)) < 0)
15371541
return code;
15381542
break;
1539-
case 0: /* no gateway */
15401543
case 3: /* domain name */
15411544
if ((code = parse_name(parser, type, &fields[3], rdata, token)) < 0)
15421545
return code;

0 commit comments

Comments
 (0)