summaryrefslogtreecommitdiff
path: root/ldpd/ldpd.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-03-11 09:03:17 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-03-11 09:03:17 -0400
commit6cd8093d3207e86d318953c3ebd4b9120078a742 (patch)
tree724e51495400799b28dfa2f08780fe11b03ec803 /ldpd/ldpd.h
parent7b26b14467f0767909c6489f5ad9aac44fb949c8 (diff)
ldpd: During code inspection we are mixing data sizes
As I understand it ldpd was originally developed as a standalone daemon for *BSD land. Then ported to FRR. FRR uses ifindex_t as the base type for the ifindex. Mixing `unsigned short` and `int` and `unsigned int` is going to lead to fun somewhere along the way. Especially when we get to run on a system with ifindex churn( I'm looking at you docker ). Attempt to convert all of ldpd to think of the ifindex as a `ifindex_t`. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ldpd/ldpd.h')
-rw-r--r--ldpd/ldpd.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/ldpd/ldpd.h b/ldpd/ldpd.h
index a5d1bb7177..006780f032 100644
--- a/ldpd/ldpd.h
+++ b/ldpd/ldpd.h
@@ -306,7 +306,7 @@ struct iface_af {
struct iface {
RB_ENTRY(iface) entry;
char name[IF_NAMESIZE];
- unsigned int ifindex;
+ ifindex_t ifindex;
struct if_addr_head addr_list;
struct in6_addr linklocal;
enum iface_type type;
@@ -391,7 +391,7 @@ struct l2vpn_if {
RB_ENTRY(l2vpn_if) entry;
struct l2vpn *l2vpn;
char ifname[IF_NAMESIZE];
- unsigned int ifindex;
+ ifindex_t ifindex;
int operative;
uint8_t mac[ETH_ALEN];
QOBJ_FIELDS
@@ -408,7 +408,7 @@ struct l2vpn_pw {
union ldpd_addr addr;
uint32_t pwid;
char ifname[IF_NAMESIZE];
- unsigned int ifindex;
+ ifindex_t ifindex;
bool enabled;
uint32_t remote_group;
uint16_t remote_mtu;
@@ -433,7 +433,7 @@ struct l2vpn {
int pw_type;
int mtu;
char br_ifname[IF_NAMESIZE];
- unsigned int br_ifindex;
+ ifindex_t br_ifindex;
struct l2vpn_if_head if_tree;
struct l2vpn_pw_head pw_tree;
struct l2vpn_pw_head pw_inactive_tree;
@@ -542,7 +542,7 @@ struct kroute {
union ldpd_addr nexthop;
uint32_t local_label;
uint32_t remote_label;
- unsigned short ifindex;
+ ifindex_t ifindex;
uint8_t route_type;
uint8_t route_instance;
uint16_t flags;
@@ -550,7 +550,7 @@ struct kroute {
struct kaddr {
char ifname[IF_NAMESIZE];
- unsigned short ifindex;
+ ifindex_t ifindex;
int af;
union ldpd_addr addr;
uint8_t prefixlen;
@@ -559,7 +559,7 @@ struct kaddr {
struct kif {
char ifname[IF_NAMESIZE];
- unsigned short ifindex;
+ ifindex_t ifindex;
int flags;
int operative;
uint8_t mac[ETH_ALEN];
@@ -577,7 +577,7 @@ struct acl_check {
struct ctl_iface {
int af;
char name[IF_NAMESIZE];
- unsigned int ifindex;
+ ifindex_t ifindex;
int state;
enum iface_type type;
uint16_t hello_holdtime;
@@ -760,7 +760,7 @@ int sock_set_bindany(int, int);
int sock_set_md5sig(int, int, union ldpd_addr *, const char *);
int sock_set_ipv4_tos(int, int);
int sock_set_ipv4_pktinfo(int, int);
-int sock_set_ipv4_recvdstaddr(int, int);
+int sock_set_ipv4_recvdstaddr(int fd, ifindex_t ifindex);
int sock_set_ipv4_recvif(int, int);
int sock_set_ipv4_minttl(int, int);
int sock_set_ipv4_ucast_ttl(int fd, int);
@@ -783,7 +783,8 @@ struct fec;
const char *log_sockaddr(void *);
const char *log_in6addr(const struct in6_addr *);
-const char *log_in6addr_scope(const struct in6_addr *, unsigned int);
+const char *log_in6addr_scope(const struct in6_addr *addr,
+ ifindex_t ifidx);
const char *log_addr(int, const union ldpd_addr *);
char *log_label(uint32_t);
const char *log_time(time_t);