diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-06-07 13:24:24 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-06-07 13:24:24 +0000 |
commit | 1b43dc959acf0334dd9dc0371d3bcefa2500ddbb (patch) | |
tree | 3e1d770515e8d30f4f0fc596ce93f9e5cd4926ed /usr.sbin/ldpd/lde.c | |
parent | 37b7fe5a53c211dd6f0c2c53b162de8984a4909f (diff) |
Store all labels in ldpd in host byte order without any additional shifting.
Add the necessary ntohl() and shifts in various places and cleanup the byte
order mess we had before. michele@ agrees.
Diffstat (limited to 'usr.sbin/ldpd/lde.c')
-rw-r--r-- | usr.sbin/ldpd/lde.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c index a4780e87ce1..cfcaa376254 100644 --- a/usr.sbin/ldpd/lde.c +++ b/usr.sbin/ldpd/lde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lde.c,v 1.15 2010/06/02 11:56:29 claudio Exp $ */ +/* $OpenBSD: lde.c,v 1.16 2010/06/07 13:24:23 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -426,7 +426,7 @@ lde_assign_label(void) /* XXX some checks needed */ label++; - return (htonl(label << MPLS_LABEL_OFFSET)); + return label; } void @@ -605,8 +605,7 @@ lde_nbr_do_mappings(struct rt_node *rn) struct lde_req *lr; struct map map; - map.label = (ntohl(rn->local_label) & MPLS_LABEL_MASK) >> - MPLS_LABEL_OFFSET; + map.label = rn->local_label; map.prefix = rn->fec.prefix.s_addr; map.prefixlen = rn->fec.prefixlen; |