summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldpd/address.c6
-rw-r--r--usr.sbin/ldpd/hello.c8
-rw-r--r--usr.sbin/ldpd/init.c5
-rw-r--r--usr.sbin/ldpd/keepalive.c4
-rw-r--r--usr.sbin/ldpd/labelmapping.c12
-rw-r--r--usr.sbin/ldpd/lde.h5
-rw-r--r--usr.sbin/ldpd/ldpd.conf.56
-rw-r--r--usr.sbin/ldpd/ldpd.h7
-rw-r--r--usr.sbin/ldpd/ldpe.h12
-rw-r--r--usr.sbin/ldpd/neighbor.c12
-rw-r--r--usr.sbin/ldpd/notification.c9
-rw-r--r--usr.sbin/ldpd/packet.c11
-rw-r--r--usr.sbin/ldpd/parse.y6
13 files changed, 39 insertions, 64 deletions
diff --git a/usr.sbin/ldpd/address.c b/usr.sbin/ldpd/address.c
index 1ea0e129331..9bba91c194a 100644
--- a/usr.sbin/ldpd/address.c
+++ b/usr.sbin/ldpd/address.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: address.c,v 1.7 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: address.c,v 1.8 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -64,7 +64,7 @@ send_address(struct nbr *nbr, struct iface *iface)
sizeof(struct address_list_tlv) +
iface_count * sizeof(struct in_addr);
- gen_ldp_hdr(buf, nbr->iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
@@ -181,7 +181,7 @@ send_address_withdraw(struct nbr *nbr, struct iface *iface)
/* XXX: multiple address on the same iface? */
size = LDP_HDR_SIZE + sizeof(struct ldp_msg) + sizeof(struct in_addr);
- gen_ldp_hdr(buf, nbr->iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c
index 1262bb7b060..d7e24d9919b 100644
--- a/usr.sbin/ldpd/hello.c
+++ b/usr.sbin/ldpd/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.16 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: hello.c,v 1.17 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -61,7 +61,7 @@ send_hello(struct iface *iface)
sizeof(struct hello_prms_tlv) +
sizeof(struct hello_prms_opt4_tlv);
- gen_ldp_hdr(buf, iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
@@ -120,7 +120,7 @@ recv_hello(struct iface *iface, struct in_addr src, char *buf, u_int16_t len)
return;
}
- nbr = nbr_find_ldpid(ldp.lsr_id, ldp.lspace_id);
+ nbr = nbr_find_ldpid(ldp.lsr_id);
if (!nbr) {
struct in_addr a;
@@ -129,7 +129,7 @@ recv_hello(struct iface *iface, struct in_addr src, char *buf, u_int16_t len)
else
a = address;
- nbr = nbr_new(ldp.lsr_id, ldp.lspace_id, iface, a);
+ nbr = nbr_new(ldp.lsr_id, iface, a);
/* set neighbor parameters */
nbr->hello_type = flags;
diff --git a/usr.sbin/ldpd/init.c b/usr.sbin/ldpd/init.c
index 11ad2280470..cccc347bbca 100644
--- a/usr.sbin/ldpd/init.c
+++ b/usr.sbin/ldpd/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.8 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: init.c,v 1.9 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -53,7 +53,7 @@ send_init(struct nbr *nbr)
size = LDP_HDR_SIZE + sizeof(struct ldp_msg) + SESS_PRMS_SIZE;
- gen_ldp_hdr(buf, nbr->iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
@@ -127,7 +127,6 @@ gen_init_prms_tlv(struct ibuf *buf, struct nbr *nbr, u_int16_t size)
parms.pvlim = 0;
parms.max_pdu_len = 0;
parms.lsr_id = nbr->id.s_addr;
- /* XXX: nbr lspace */
parms.lspace_id = 0;
return (ibuf_add(buf, &parms, SESS_PRMS_SIZE));
diff --git a/usr.sbin/ldpd/keepalive.c b/usr.sbin/ldpd/keepalive.c
index dce3c1166fb..0207a983973 100644
--- a/usr.sbin/ldpd/keepalive.c
+++ b/usr.sbin/ldpd/keepalive.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keepalive.c,v 1.8 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: keepalive.c,v 1.9 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -48,7 +48,7 @@ send_keepalive(struct nbr *nbr)
size = LDP_HDR_SIZE + sizeof(struct ldp_msg);
- gen_ldp_hdr(buf, nbr->iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index c9b43ee89fe..b44d4f56b90 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.20 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.21 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -60,7 +60,7 @@ send_labelmapping(struct nbr *nbr)
fatal("send_labelmapping");
/* real size will be set up later */
- gen_ldp_hdr(buf, nbr->iface, 0);
+ gen_ldp_hdr(buf, 0);
size = LDP_HDR_SIZE - TLV_HDR_LEN;
@@ -171,7 +171,7 @@ send_labelrequest(struct nbr *nbr)
fatal("send_labelrequest");
/* real size will be set up later */
- gen_ldp_hdr(buf, nbr->iface, 0);
+ gen_ldp_hdr(buf, 0);
size = LDP_HDR_SIZE - TLV_HDR_LEN;
@@ -265,7 +265,7 @@ send_labelwithdraw(struct nbr *nbr)
fatal("send_labelwithdraw");
/* real size will be set up later */
- gen_ldp_hdr(buf, nbr->iface, 0);
+ gen_ldp_hdr(buf, 0);
size = LDP_HDR_SIZE - TLV_HDR_LEN;
@@ -403,7 +403,7 @@ send_labelrelease(struct nbr *nbr)
fatal("send_labelrelease");
/* real size will be set up later */
- gen_ldp_hdr(buf, nbr->iface, 0);
+ gen_ldp_hdr(buf, 0);
size = LDP_HDR_SIZE - TLV_HDR_LEN;
@@ -539,7 +539,7 @@ send_labelabortreq(struct nbr *nbr)
size = LDP_HDR_SIZE + sizeof(struct ldp_msg);
- gen_ldp_hdr(buf, nbr->iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
diff --git a/usr.sbin/ldpd/lde.h b/usr.sbin/ldpd/lde.h
index 7dbeceed33a..c74c551b06c 100644
--- a/usr.sbin/ldpd/lde.h
+++ b/usr.sbin/ldpd/lde.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde.h,v 1.18 2010/11/04 09:49:07 claudio Exp $ */
+/* $OpenBSD: lde.h,v 1.19 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -73,8 +73,6 @@ struct lde_nbr {
u_int32_t peerid;
unsigned int ifindex;
int state;
-
- u_int16_t lspace;
};
struct rt_lsp {
@@ -93,7 +91,6 @@ struct rt_node {
LIST_HEAD(, lde_map) upstream; /* sent mappings */
u_int32_t local_label;
- u_int16_t lspace;
u_int8_t flags;
};
diff --git a/usr.sbin/ldpd/ldpd.conf.5 b/usr.sbin/ldpd/ldpd.conf.5
index 8a78c4fcf6c..04ca539034e 100644
--- a/usr.sbin/ldpd/ldpd.conf.5
+++ b/usr.sbin/ldpd/ldpd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ldpd.conf.5,v 1.9 2013/06/01 18:35:02 claudio Exp $
+.\" $OpenBSD: ldpd.conf.5,v 1.10 2013/06/01 18:47:07 claudio Exp $
.\"
.\" Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
.\" Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -80,10 +80,6 @@ The default is
.It Ic router-id Ar address
Set the router ID; in combination with labelspace it forms the LSR-ID.
.Pp
-.It Ic labelspace Ar number
-Set the label space advertised by
-.Xr ldpd 8 .
-.Pp
.It Ic keepalive Ar seconds
Set the keepalive interval in seconds.
The default value is 180; valid range is 1\-65535.
diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index 516a33f86e5..585880d701f 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.33 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: ldpd.h,v 1.34 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -203,8 +203,6 @@ struct iface {
struct in_addr dst;
struct in_addr mask;
- u_int16_t lspace_id;
-
u_int64_t baudrate;
time_t uptime;
unsigned int ifindex;
@@ -291,7 +289,6 @@ struct ctl_iface {
char name[IF_NAMESIZE];
struct in_addr addr;
struct in_addr mask;
- struct in_addr lspace;
struct in_addr rtr_id;
struct in_addr dr_id;
struct in_addr dr_addr;
@@ -320,7 +317,6 @@ struct ctl_nbr {
struct in_addr addr;
struct in_addr dr;
struct in_addr bdr;
- struct in_addr lspace;
time_t dead_timer;
time_t uptime;
u_int32_t db_sum_lst_cnt;
@@ -336,7 +332,6 @@ struct ctl_nbr {
struct ctl_rt {
struct in_addr prefix;
struct in_addr nexthop;
- struct in_addr lspace;
struct in_addr adv_rtr;
time_t uptime;
u_int32_t local_label;
diff --git a/usr.sbin/ldpd/ldpe.h b/usr.sbin/ldpd/ldpe.h
index f45a27aeb5a..430a278ce9a 100644
--- a/usr.sbin/ldpd/ldpe.h
+++ b/usr.sbin/ldpd/ldpe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.h,v 1.19 2013/06/01 18:16:35 claudio Exp $ */
+/* $OpenBSD: ldpe.h,v 1.20 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -62,7 +62,6 @@ struct nbr {
int fd;
int state;
- u_int16_t lspace;
u_int16_t holdtime;
u_int16_t keepalive;
@@ -95,8 +94,7 @@ int recv_keepalive(struct nbr *, char *, u_int16_t);
/* notification.c */
void send_notification_nbr(struct nbr *, u_int32_t, u_int32_t, u_int32_t);
-struct ibuf *send_notification(u_int32_t, struct iface *, u_int32_t,
- u_int32_t);
+struct ibuf *send_notification(u_int32_t, u_int32_t, u_int32_t);
int recv_notification(struct nbr *, char *, u_int16_t);
/* address.c */
@@ -151,11 +149,11 @@ int if_set_tos(int, int);
int if_set_reuse(int, int);
/* neighbor.c */
-struct nbr *nbr_new(u_int32_t, u_int16_t, struct iface *, struct in_addr);
+struct nbr *nbr_new(u_int32_t, struct iface *, struct in_addr);
void nbr_del(struct nbr *);
struct nbr *nbr_find_ip(u_int32_t);
-struct nbr *nbr_find_ldpid(u_int32_t, u_int16_t);
+struct nbr *nbr_find_ldpid(u_int32_t);
struct nbr *nbr_find_peerid(u_int32_t);
int nbr_fsm(struct nbr *, enum nbr_event);
@@ -192,7 +190,7 @@ struct ctl_nbr *nbr_to_ctl(struct nbr *);
void ldpe_nbr_ctl(struct ctl_conn *);
/* packet.c */
-int gen_ldp_hdr(struct ibuf *, struct iface *, u_int16_t);
+int gen_ldp_hdr(struct ibuf *, u_int16_t);
int gen_msg_tlv(struct ibuf *, u_int32_t, u_int16_t);
int send_packet(struct iface *, void *, size_t, struct sockaddr_in *);
void disc_recv_packet(int, short, void *);
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index 835257a955c..64d0bb2005f 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.30 2013/06/01 18:24:28 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.31 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -62,8 +62,6 @@ RB_GENERATE(nbr_pid_head, nbr, pid_tree, nbr_pid_compare)
static __inline int
nbr_id_compare(struct nbr *a, struct nbr *b)
{
- if (ntohl(a->id.s_addr) - ntohl(b->id.s_addr) == 0)
- return (a->lspace - b->lspace);
return (ntohl(a->id.s_addr) - ntohl(b->id.s_addr));
}
@@ -235,8 +233,7 @@ nbr_fsm(struct nbr *nbr, enum nbr_event event)
}
struct nbr *
-nbr_new(u_int32_t nbr_id, u_int16_t lspace, struct iface *iface,
- struct in_addr a)
+nbr_new(u_int32_t nbr_id, struct iface *iface, struct in_addr a)
{
struct nbr *nbr;
@@ -247,7 +244,6 @@ nbr_new(u_int32_t nbr_id, u_int16_t lspace, struct iface *iface,
nbr->state = NBR_STA_DOWN;
nbr->id.s_addr = nbr_id;
- nbr->lspace = lspace;
nbr->iface = iface;
nbr->addr = a;
@@ -317,11 +313,10 @@ nbr_find_ip(u_int32_t addr)
}
struct nbr *
-nbr_find_ldpid(u_int32_t rtr_id, u_int16_t lspace)
+nbr_find_ldpid(u_int32_t rtr_id)
{
struct nbr n;
n.id.s_addr = rtr_id;
- n.lspace = lspace;
return (RB_FIND(nbr_id_head, &nbrs_by_id, &n));
}
@@ -595,7 +590,6 @@ nbr_act_session_operational(struct nbr *nbr)
bzero(&rn, sizeof(rn));
rn.id.s_addr = nbr->id.s_addr;
- rn.lspace = nbr->lspace;
return (ldpe_imsg_compose_lde(IMSG_NEIGHBOR_UP, nbr->peerid, 0, &rn,
sizeof(rn)));
diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c
index 454584240b9..2cf419f5a60 100644
--- a/usr.sbin/ldpd/notification.c
+++ b/usr.sbin/ldpd/notification.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: notification.c,v 1.10 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: notification.c,v 1.11 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -45,13 +45,12 @@ send_notification_nbr(struct nbr *nbr, u_int32_t status, u_int32_t msgid,
{
struct ibuf *buf;
- buf = send_notification(status, nbr->iface, msgid, type);
+ buf = send_notification(status, msgid, type);
evbuf_enqueue(&nbr->wbuf, buf);
}
struct ibuf *
-send_notification(u_int32_t status, struct iface *iface, u_int32_t msgid,
- u_int32_t type)
+send_notification(u_int32_t status, u_int32_t msgid, u_int32_t type)
{
struct ibuf *buf;
u_int16_t size;
@@ -61,7 +60,7 @@ send_notification(u_int32_t status, struct iface *iface, u_int32_t msgid,
size = LDP_HDR_SIZE + sizeof(struct ldp_msg) + STATUS_SIZE;
- gen_ldp_hdr(buf, iface, size);
+ gen_ldp_hdr(buf, size);
size -= LDP_HDR_SIZE;
diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c
index f32a807647e..879c95b7b1b 100644
--- a/usr.sbin/ldpd/packet.c
+++ b/usr.sbin/ldpd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.22 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.23 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -47,7 +47,7 @@ ssize_t session_get_pdu(struct ibuf_read *, char **);
static int msgcnt = 0;
int
-gen_ldp_hdr(struct ibuf *buf, struct iface *iface, u_int16_t size)
+gen_ldp_hdr(struct ibuf *buf, u_int16_t size)
{
struct ldp_hdr ldp_hdr;
@@ -59,8 +59,7 @@ gen_ldp_hdr(struct ibuf *buf, struct iface *iface, u_int16_t size)
ldp_hdr.length = htons(size);
ldp_hdr.lsr_id = ldpe_router_id();
- if (iface)
- ldp_hdr.lspace_id = iface->lspace_id;
+ ldp_hdr.lspace_id = 0;
return (ibuf_add(buf, &ldp_hdr, LDP_HDR_SIZE));
}
@@ -212,7 +211,7 @@ ldp_hdr_sanity_check(struct ldp_hdr *ldp_hdr, u_int16_t len,
{
struct in_addr addr;
- if (ldp_hdr->lspace_id != iface->lspace_id) {
+ if (ldp_hdr->lspace_id != 0) {
addr.s_addr = ldp_hdr->lspace_id;
log_debug("ldp_hdr_sanity_check: invalid label space "
"ID %s, interface %s", inet_ntoa(addr),
@@ -283,7 +282,7 @@ session_accept(int fd, short event, void *bula)
Hello adjacency: try to send notification */
log_warnx("Connection attempt from unknown neighbor %s: %s",
inet_ntoa(src.sin_addr), "NO HELLO");
- buf = send_notification(S_NO_HELLO, NULL, 0, 0);
+ buf = send_notification(S_NO_HELLO, 0, 0);
write(newfd, buf->buf, buf->wpos);
ibuf_free(buf);
close(newfd);
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index 29b429b51c1..31f3a31078e 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.12 2013/06/01 18:35:02 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2013/06/01 18:47:07 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -93,7 +93,6 @@ struct config_defaults {
};
struct config_defaults globaldefs;
-struct config_defaults lspacedefs;
struct config_defaults ifacedefs;
struct config_defaults *defs;
@@ -109,7 +108,7 @@ typedef struct {
%}
-%token LSPACE INTERFACE ROUTERID FIBUPDATE
+%token INTERFACE ROUTERID FIBUPDATE
%token HOLDTIME HELLOINTERVAL KEEPALIVE
%token DISTRIBUTION RETENTION ADVERTISEMENT
%token EXTTAG
@@ -359,7 +358,6 @@ lookup(char *s)
{"holdtime", HOLDTIME},
{"interface", INTERFACE},
{"keepalive", KEEPALIVE},
- {"labelspace", LSPACE},
{"retention", RETENTION},
{"router-id", ROUTERID},
{"yes", YES}