mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 03:27:25 +00:00
Merge pull request #5974 from donaldsharp/ldp_ifindex_missed
ldpd: During code inspection we are mixing data sizes
This commit is contained in:
commit
312785ddf1
@ -169,7 +169,7 @@ recv_hello(struct in_addr lsr_id, struct ldp_msg *msg, int af,
|
|||||||
int tlvs_rcvd;
|
int tlvs_rcvd;
|
||||||
int ds_tlv;
|
int ds_tlv;
|
||||||
union ldpd_addr trans_addr;
|
union ldpd_addr trans_addr;
|
||||||
uint32_t scope_id = 0;
|
ifindex_t scope_id = 0;
|
||||||
uint32_t conf_seqnum;
|
uint32_t conf_seqnum;
|
||||||
uint16_t trans_pref;
|
uint16_t trans_pref;
|
||||||
int r;
|
int r;
|
||||||
|
@ -109,7 +109,7 @@ ldpe_if_exit(struct iface *iface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct iface *
|
struct iface *
|
||||||
if_lookup(struct ldpd_conf *xconf, unsigned short ifindex)
|
if_lookup(struct ldpd_conf *xconf, ifindex_t ifindex)
|
||||||
{
|
{
|
||||||
struct iface *iface;
|
struct iface *iface;
|
||||||
|
|
||||||
|
21
ldpd/ldpd.h
21
ldpd/ldpd.h
@ -306,7 +306,7 @@ struct iface_af {
|
|||||||
struct iface {
|
struct iface {
|
||||||
RB_ENTRY(iface) entry;
|
RB_ENTRY(iface) entry;
|
||||||
char name[IF_NAMESIZE];
|
char name[IF_NAMESIZE];
|
||||||
unsigned int ifindex;
|
ifindex_t ifindex;
|
||||||
struct if_addr_head addr_list;
|
struct if_addr_head addr_list;
|
||||||
struct in6_addr linklocal;
|
struct in6_addr linklocal;
|
||||||
enum iface_type type;
|
enum iface_type type;
|
||||||
@ -391,7 +391,7 @@ struct l2vpn_if {
|
|||||||
RB_ENTRY(l2vpn_if) entry;
|
RB_ENTRY(l2vpn_if) entry;
|
||||||
struct l2vpn *l2vpn;
|
struct l2vpn *l2vpn;
|
||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
unsigned int ifindex;
|
ifindex_t ifindex;
|
||||||
int operative;
|
int operative;
|
||||||
uint8_t mac[ETH_ALEN];
|
uint8_t mac[ETH_ALEN];
|
||||||
QOBJ_FIELDS
|
QOBJ_FIELDS
|
||||||
@ -408,7 +408,7 @@ struct l2vpn_pw {
|
|||||||
union ldpd_addr addr;
|
union ldpd_addr addr;
|
||||||
uint32_t pwid;
|
uint32_t pwid;
|
||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
unsigned int ifindex;
|
ifindex_t ifindex;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
uint32_t remote_group;
|
uint32_t remote_group;
|
||||||
uint16_t remote_mtu;
|
uint16_t remote_mtu;
|
||||||
@ -433,7 +433,7 @@ struct l2vpn {
|
|||||||
int pw_type;
|
int pw_type;
|
||||||
int mtu;
|
int mtu;
|
||||||
char br_ifname[IF_NAMESIZE];
|
char br_ifname[IF_NAMESIZE];
|
||||||
unsigned int br_ifindex;
|
ifindex_t br_ifindex;
|
||||||
struct l2vpn_if_head if_tree;
|
struct l2vpn_if_head if_tree;
|
||||||
struct l2vpn_pw_head pw_tree;
|
struct l2vpn_pw_head pw_tree;
|
||||||
struct l2vpn_pw_head pw_inactive_tree;
|
struct l2vpn_pw_head pw_inactive_tree;
|
||||||
@ -542,7 +542,7 @@ struct kroute {
|
|||||||
union ldpd_addr nexthop;
|
union ldpd_addr nexthop;
|
||||||
uint32_t local_label;
|
uint32_t local_label;
|
||||||
uint32_t remote_label;
|
uint32_t remote_label;
|
||||||
unsigned short ifindex;
|
ifindex_t ifindex;
|
||||||
uint8_t route_type;
|
uint8_t route_type;
|
||||||
uint8_t route_instance;
|
uint8_t route_instance;
|
||||||
uint16_t flags;
|
uint16_t flags;
|
||||||
@ -550,7 +550,7 @@ struct kroute {
|
|||||||
|
|
||||||
struct kaddr {
|
struct kaddr {
|
||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
unsigned short ifindex;
|
ifindex_t ifindex;
|
||||||
int af;
|
int af;
|
||||||
union ldpd_addr addr;
|
union ldpd_addr addr;
|
||||||
uint8_t prefixlen;
|
uint8_t prefixlen;
|
||||||
@ -559,7 +559,7 @@ struct kaddr {
|
|||||||
|
|
||||||
struct kif {
|
struct kif {
|
||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
unsigned short ifindex;
|
ifindex_t ifindex;
|
||||||
int flags;
|
int flags;
|
||||||
int operative;
|
int operative;
|
||||||
uint8_t mac[ETH_ALEN];
|
uint8_t mac[ETH_ALEN];
|
||||||
@ -577,7 +577,7 @@ struct acl_check {
|
|||||||
struct ctl_iface {
|
struct ctl_iface {
|
||||||
int af;
|
int af;
|
||||||
char name[IF_NAMESIZE];
|
char name[IF_NAMESIZE];
|
||||||
unsigned int ifindex;
|
ifindex_t ifindex;
|
||||||
int state;
|
int state;
|
||||||
enum iface_type type;
|
enum iface_type type;
|
||||||
uint16_t hello_holdtime;
|
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_md5sig(int, int, union ldpd_addr *, const char *);
|
||||||
int sock_set_ipv4_tos(int, int);
|
int sock_set_ipv4_tos(int, int);
|
||||||
int sock_set_ipv4_pktinfo(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_recvif(int, int);
|
||||||
int sock_set_ipv4_minttl(int, int);
|
int sock_set_ipv4_minttl(int, int);
|
||||||
int sock_set_ipv4_ucast_ttl(int fd, int);
|
int sock_set_ipv4_ucast_ttl(int fd, int);
|
||||||
@ -783,7 +783,8 @@ struct fec;
|
|||||||
|
|
||||||
const char *log_sockaddr(void *);
|
const char *log_sockaddr(void *);
|
||||||
const char *log_in6addr(const struct in6_addr *);
|
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 *);
|
const char *log_addr(int, const union ldpd_addr *);
|
||||||
char *log_label(uint32_t);
|
char *log_label(uint32_t);
|
||||||
const char *log_time(time_t);
|
const char *log_time(time_t);
|
||||||
|
@ -41,7 +41,7 @@ static int ldpe_dispatch_pfkey(struct thread *);
|
|||||||
#endif
|
#endif
|
||||||
static void ldpe_setup_sockets(int, int, int, int);
|
static void ldpe_setup_sockets(int, int, int, int);
|
||||||
static void ldpe_close_sockets(int);
|
static void ldpe_close_sockets(int);
|
||||||
static void ldpe_iface_af_ctl(struct ctl_conn *, int, unsigned int);
|
static void ldpe_iface_af_ctl(struct ctl_conn *c, int af, ifindex_t ifidx);
|
||||||
|
|
||||||
struct ldpd_conf *leconf;
|
struct ldpd_conf *leconf;
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
@ -827,7 +827,7 @@ ldpe_stop_init_backoff(int af)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ldpe_iface_af_ctl(struct ctl_conn *c, int af, unsigned int idx)
|
ldpe_iface_af_ctl(struct ctl_conn *c, int af, ifindex_t idx)
|
||||||
{
|
{
|
||||||
struct iface *iface;
|
struct iface *iface;
|
||||||
struct iface_af *ia;
|
struct iface_af *ia;
|
||||||
@ -847,7 +847,7 @@ ldpe_iface_af_ctl(struct ctl_conn *c, int af, unsigned int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ldpe_iface_ctl(struct ctl_conn *c, unsigned int idx)
|
ldpe_iface_ctl(struct ctl_conn *c, ifindex_t idx)
|
||||||
{
|
{
|
||||||
ldpe_iface_af_ctl(c, AF_INET, idx);
|
ldpe_iface_af_ctl(c, AF_INET, idx);
|
||||||
ldpe_iface_af_ctl(c, AF_INET6, idx);
|
ldpe_iface_af_ctl(c, AF_INET6, idx);
|
||||||
|
@ -92,7 +92,7 @@ struct nbr {
|
|||||||
struct in_addr id; /* lsr id */
|
struct in_addr id; /* lsr id */
|
||||||
union ldpd_addr laddr; /* local address */
|
union ldpd_addr laddr; /* local address */
|
||||||
union ldpd_addr raddr; /* remote address */
|
union ldpd_addr raddr; /* remote address */
|
||||||
uint32_t raddr_scope; /* remote address scope (v6) */
|
ifindex_t raddr_scope; /* remote address scope (v6) */
|
||||||
time_t uptime;
|
time_t uptime;
|
||||||
int fd;
|
int fd;
|
||||||
int state;
|
int state;
|
||||||
@ -208,7 +208,7 @@ void ldpe_reset_ds_nbrs(void);
|
|||||||
void ldpe_remove_dynamic_tnbrs(int);
|
void ldpe_remove_dynamic_tnbrs(int);
|
||||||
void ldpe_stop_init_backoff(int);
|
void ldpe_stop_init_backoff(int);
|
||||||
struct ctl_conn;
|
struct ctl_conn;
|
||||||
void ldpe_iface_ctl(struct ctl_conn *, unsigned int);
|
void ldpe_iface_ctl(struct ctl_conn *c, ifindex_t ifidx);
|
||||||
void ldpe_adj_ctl(struct ctl_conn *);
|
void ldpe_adj_ctl(struct ctl_conn *);
|
||||||
void ldpe_adj_detail_ctl(struct ctl_conn *);
|
void ldpe_adj_detail_ctl(struct ctl_conn *);
|
||||||
void ldpe_nbr_ctl(struct ctl_conn *);
|
void ldpe_nbr_ctl(struct ctl_conn *);
|
||||||
@ -219,7 +219,7 @@ void mapping_list_clr(struct mapping_head *);
|
|||||||
struct iface *if_new(const char *);
|
struct iface *if_new(const char *);
|
||||||
void ldpe_if_init(struct iface *);
|
void ldpe_if_init(struct iface *);
|
||||||
void ldpe_if_exit(struct iface *);
|
void ldpe_if_exit(struct iface *);
|
||||||
struct iface *if_lookup(struct ldpd_conf *, unsigned short);
|
struct iface *if_lookup(struct ldpd_conf *c, ifindex_t ifidx);
|
||||||
struct iface *if_lookup_name(struct ldpd_conf *, const char *);
|
struct iface *if_lookup_name(struct ldpd_conf *, const char *);
|
||||||
void if_update_info(struct iface *, struct kif *);
|
void if_update_info(struct iface *, struct kif *);
|
||||||
struct iface_af *iface_af_get(struct iface *, int);
|
struct iface_af *iface_af_get(struct iface *, int);
|
||||||
|
@ -59,7 +59,7 @@ log_in6addr(const struct in6_addr *addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
log_in6addr_scope(const struct in6_addr *addr, unsigned int ifindex)
|
log_in6addr_scope(const struct in6_addr *addr, ifindex_t ifindex)
|
||||||
{
|
{
|
||||||
struct sockaddr_in6 sa_in6;
|
struct sockaddr_in6 sa_in6;
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ sock_set_ipv4_tos(int fd, int tos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sock_set_ipv4_recvif(int fd, int enable)
|
sock_set_ipv4_recvif(int fd, ifindex_t enable)
|
||||||
{
|
{
|
||||||
return (setsockopt_ifindex(AF_INET, fd, enable));
|
return (setsockopt_ifindex(AF_INET, fd, enable));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user