diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-10-10 14:09:26 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-10-10 14:09:26 +0000 |
commit | 34c540de32da6090afdcdd6fee481f9a2df345fd (patch) | |
tree | cd80eb9d2e40cb44f8f68b64fe72f80016049023 /usr.sbin/ospf6d/database.c | |
parent | 00614674fd7c30c31cd6d99eee5ef9d519d5da32 (diff) |
send_packet() now takes a struct in6_addr as destination instead of a
struct sockaddr_in6 and builds the struct sockaddr_in6 internaly adding scope
if necessary. While there switch to sendto() we don't need any of the sendmsg()
features here.
OK norby@
Diffstat (limited to 'usr.sbin/ospf6d/database.c')
-rw-r--r-- | usr.sbin/ospf6d/database.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/ospf6d/database.c b/usr.sbin/ospf6d/database.c index 955bc469b40..6eeb4d467ca 100644 --- a/usr.sbin/ospf6d/database.c +++ b/usr.sbin/ospf6d/database.c @@ -1,4 +1,4 @@ -/* $OpenBSD: database.c,v 1.1 2007/10/08 10:44:50 norby Exp $ */ +/* $OpenBSD: database.c,v 1.2 2007/10/10 14:09:25 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -40,7 +40,7 @@ void db_sum_list_next(struct nbr *); int send_db_description(struct nbr *nbr) { - struct sockaddr_in6 dst; + struct in6_addr dst; struct db_dscrp_hdr dd_hdr; struct lsa_entry *le, *nle; struct buf *buf; @@ -113,17 +113,13 @@ send_db_description(struct nbr *nbr) fatalx("send_db_description: unknown neighbor state"); } - /* set destination */ - dst.sin6_family = AF_INET6; - dst.sin6_len = sizeof(struct sockaddr_in6); - switch (nbr->iface->type) { case IF_TYPE_POINTOPOINT: - inet_pton(AF_INET6, AllSPFRouters, &dst.sin6_addr); + inet_pton(AF_INET6, AllSPFRouters, &dst); dd_hdr.iface_mtu = htons(nbr->iface->mtu); break; case IF_TYPE_BROADCAST: - dst.sin6_addr = nbr->addr; + dst = nbr->addr; dd_hdr.iface_mtu = htons(nbr->iface->mtu); break; case IF_TYPE_NBMA: @@ -131,7 +127,7 @@ send_db_description(struct nbr *nbr) /* XXX not supported */ break; case IF_TYPE_VIRTUALLINK: - dst.sin6_addr = nbr->iface->dst; + dst = nbr->iface->dst; dd_hdr.iface_mtu = 0; break; default: |