diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2024-08-21 15:16:57 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2024-08-21 15:16:57 +0000 |
commit | 3726f707e4720e08cd775df720cae6543f2dc3f5 (patch) | |
tree | 739540a6d42fa5b705c61ea40750676b751f0ea7 /usr.sbin | |
parent | e1434f8d77b34090b98c44d17f9d8c14852b17dd (diff) |
An area is either a decimal number or an IPv4 address.
This lets us replace inet_aton with inet_pton since we do not need
inet_aton's flexibility.
phessler, sthen and Tom Smyth all confirm that they never came across
a different way of specifying an area.
OK claudio, deraadt
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospfd/parse.y | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y index 82f51bfdd44..28523c23382 100644 --- a/usr.sbin/ospfd/parse.y +++ b/usr.sbin/ospfd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.104 2021/10/15 15:01:28 naddy Exp $ */ +/* $OpenBSD: parse.y,v 1.105 2024/08/21 15:16:56 florian Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -225,7 +225,7 @@ varset : STRING '=' string { ; conf_main : ROUTERID STRING { - if (!inet_aton($2, &conf->rtr_id)) { + if (inet_pton(AF_INET, $2, &conf->rtr_id) != 1) { yyerror("error parsing router-id"); free($2); YYERROR; @@ -620,7 +620,7 @@ areaid : NUMBER { $$.s_addr = htonl($1); } | STRING { - if (inet_aton($1, &$$) == 0) { + if (inet_pton(AF_INET, $1, &$$) != 1) { yyerror("error parsing area"); free($1); YYERROR; @@ -683,7 +683,7 @@ interface : INTERFACE STRING { s = strchr($2, ':'); if (s) { *s++ = '\0'; - if (inet_aton(s, &addr) == 0) { + if (inet_pton(AF_INET, s, &addr) != 1) { yyerror( "error parsing interface address"); free($2); |