-/* $OpenBSD: database.c,v 1.37 2023/06/20 15:19:55 claudio Exp $ */
+/* $OpenBSD: database.c,v 1.38 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
switch (nbr->iface->type) {
case IF_TYPE_POINTOPOINT:
- inet_aton(AllSPFRouters, &dst.sin_addr);
+ inet_pton(AF_INET, AllSPFRouters, &dst.sin_addr);
dd_hdr.iface_mtu = htons(nbr->iface->mtu);
break;
case IF_TYPE_BROADCAST:
-/* $OpenBSD: hello.c,v 1.26 2022/12/28 21:30:18 jmc Exp $ */
+/* $OpenBSD: hello.c,v 1.27 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
switch (iface->type) {
case IF_TYPE_POINTOPOINT:
case IF_TYPE_BROADCAST:
- inet_aton(AllSPFRouters, &dst.sin_addr);
+ inet_pton(AF_INET, AllSPFRouters, &dst.sin_addr);
break;
case IF_TYPE_NBMA:
case IF_TYPE_POINTOMULTIPOINT:
-/* $OpenBSD: interface.c,v 1.87 2023/03/08 04:43:14 guenther Exp $ */
+/* $OpenBSD: interface.c,v 1.88 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
switch (iface->type) {
case IF_TYPE_POINTOPOINT:
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
if (if_join_group(iface, &addr))
return (-1);
iface->state = IF_STA_POINTTOPOINT;
if_type_name(iface->type), iface->name);
return (-1);
case IF_TYPE_BROADCAST:
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
if (if_join_group(iface, &addr))
return (-1);
if (iface->priority == 0) {
iface->bdr = bdr;
if (changed) {
- inet_aton(AllDRouters, &addr);
+ inet_pton(AF_INET, AllDRouters, &addr);
if (old_state & IF_STA_DRORBDR &&
(iface->state & IF_STA_DRORBDR) == 0) {
if (if_leave_group(iface, &addr))
case IF_TYPE_POINTOPOINT:
case IF_TYPE_BROADCAST:
/* try to cleanup */
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
if_leave_group(iface, &addr);
if (iface->state & IF_STA_DRORBDR) {
- inet_aton(AllDRouters, &addr);
+ inet_pton(AF_INET, AllDRouters, &addr);
if_leave_group(iface, &addr);
}
break;
-/* $OpenBSD: lsack.c,v 1.24 2023/03/08 04:43:14 guenther Exp $ */
+/* $OpenBSD: lsack.c,v 1.25 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
/* send LS ack(s) but first set correct destination */
switch (iface->type) {
case IF_TYPE_POINTOPOINT:
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
send_ls_ack(iface, addr, buf);
break;
case IF_TYPE_BROADCAST:
if (iface->state & IF_STA_DRORBDR)
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
else
- inet_aton(AllDRouters, &addr);
+ inet_pton(AF_INET, AllDRouters, &addr);
send_ls_ack(iface, addr, buf);
break;
case IF_TYPE_NBMA:
-/* $OpenBSD: lsreq.c,v 1.24 2023/03/08 04:43:14 guenther Exp $ */
+/* $OpenBSD: lsreq.c,v 1.25 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
switch (nbr->iface->type) {
case IF_TYPE_POINTOPOINT:
- inet_aton(AllSPFRouters, &dst.sin_addr);
+ inet_pton(AF_INET, AllSPFRouters, &dst.sin_addr);
break;
case IF_TYPE_BROADCAST:
case IF_TYPE_NBMA:
-/* $OpenBSD: lsupdate.c,v 1.53 2023/06/21 07:44:08 claudio Exp $ */
+/* $OpenBSD: lsupdate.c,v 1.54 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
* because the router switched lately to DR or BDR
*/
if (le->le_oneshot && nbr->iface->state & IF_STA_DRORBDR)
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
else if (nbr->iface->state & IF_STA_DRORBDR) {
/*
* old retransmission needs to be converted into
} else if (nbr->iface->type == IF_TYPE_POINTOPOINT)
memcpy(&addr, &nbr->addr, sizeof(addr));
else
- inet_aton(AllDRouters, &addr);
+ inet_pton(AF_INET, AllDRouters, &addr);
} else
memcpy(&addr, &nbr->addr, sizeof(addr));
-/* $OpenBSD: packet.c,v 1.37 2023/07/03 09:40:47 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.38 2024/08/21 15:18:00 florian Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
* or to the address of the interface itself.
* AllDRouters is only valid for DR and BDR but this is checked later.
*/
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
if (ip_hdr.ip_dst.s_addr != addr.s_addr) {
- inet_aton(AllDRouters, &addr);
+ inet_pton(AF_INET, AllDRouters, &addr);
if (ip_hdr.ip_dst.s_addr != addr.s_addr) {
if (ip_hdr.ip_dst.s_addr != iface->addr.s_addr) {
log_debug("recv_packet: packet sent to wrong "
/* switch OSPF packet type */
switch (ospf_hdr->type) {
case PACKET_TYPE_HELLO:
- inet_aton(AllSPFRouters, &addr);
+ inet_pton(AF_INET, AllSPFRouters, &addr);
if (iface->type == IF_TYPE_BROADCAST ||
iface->type == IF_TYPE_POINTOPOINT)
if (ip_hdr.ip_dst.s_addr != addr.s_addr) {
}
if (iface->type == IF_TYPE_BROADCAST || iface->type == IF_TYPE_NBMA) {
- if (inet_aton(AllDRouters, &addr) == 0)
- fatalx("recv_packet: inet_aton");
+ inet_pton(AF_INET, AllDRouters, &addr);
if (ip_hdr->ip_dst.s_addr == addr.s_addr &&
(iface->state & IF_STA_DRORBDR) == 0) {
log_debug("recv_packet: invalid destination IP in "