summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d/lsreq.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2007-10-10 14:09:26 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2007-10-10 14:09:26 +0000
commit34c540de32da6090afdcdd6fee481f9a2df345fd (patch)
treecd80eb9d2e40cb44f8f68b64fe72f80016049023 /usr.sbin/ospf6d/lsreq.c
parent00614674fd7c30c31cd6d99eee5ef9d519d5da32 (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/lsreq.c')
-rw-r--r--usr.sbin/ospf6d/lsreq.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/usr.sbin/ospf6d/lsreq.c b/usr.sbin/ospf6d/lsreq.c
index 76c92129b65..40ea4d25511 100644
--- a/usr.sbin/ospf6d/lsreq.c
+++ b/usr.sbin/ospf6d/lsreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lsreq.c,v 1.1 2007/10/08 10:44:50 norby Exp $ */
+/* $OpenBSD: lsreq.c,v 1.2 2007/10/10 14:09:25 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org>
@@ -33,7 +33,7 @@ extern struct imsgbuf *ibuf_rde;
int
send_ls_req(struct nbr *nbr)
{
- struct sockaddr_in6 dst;
+ struct in6_addr dst;
struct ls_req_hdr ls_req_hdr;
struct lsa_entry *le, *nle;
struct buf *buf;
@@ -42,21 +42,15 @@ send_ls_req(struct nbr *nbr)
if ((buf = buf_open(nbr->iface->mtu - sizeof(struct ip))) == NULL)
fatal("send_ls_req");
- /* set destination */
- dst.sin6_family = AF_INET6;
- dst.sin6_len = sizeof(struct sockaddr_in6);
-
switch (nbr->iface->type) {
case IF_TYPE_POINTOPOINT:
-//XXX inet_aton(AllSPFRouters, &dst.sin_addr);
- inet_pton(AF_INET6, AllSPFRouters, &dst.sin6_addr);
+ inet_pton(AF_INET6, AllSPFRouters, &dst);
break;
case IF_TYPE_BROADCAST:
case IF_TYPE_NBMA:
case IF_TYPE_POINTOMULTIPOINT:
case IF_TYPE_VIRTUALLINK:
-//XXX dst.sin_addr.s_addr = nbr->addr.s_addr;
- dst.sin6_addr = nbr->addr;
+ dst = nbr->addr;
break;
default:
fatalx("send_ls_req: unknown interface type");