diff options
| author | 2007-10-10 14:09:25 +0000 | |
|---|---|---|
| committer | 2007-10-10 14:09:25 +0000 | |
| commit | 52bf80cbd196f0d39ff5de0f77180e965e3729e1 (patch) | |
| tree | 58836f6b16b9d9151f2e6f60b0f2f22153d6ec7d /usr.sbin/ospf6d/database.c | |
| parent | Address scope was probably the most stupid idea comming out of IPv6. (diff) | |
| download | wireguard-openbsd-52bf80cbd196f0d39ff5de0f77180e965e3729e1.tar.xz wireguard-openbsd-52bf80cbd196f0d39ff5de0f77180e965e3729e1.zip | |
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: |
