if (!ei)
return "inactive";
- ifaddr = ntohl(ei->address->u.prefix4.s_addr);
+ ifaddr = ntohl(ei->address.u.prefix4.s_addr);
snprintf(buf, EIGRP_IF_STRING_MAXLEN, "%u.%u.%u.%u",
(ifaddr >> 24) & 0xff, (ifaddr >> 16) & 0xff,
(ifaddr >> 8) & 0xff, ifaddr & 0xff);
struct TLV_Peer_Termination_type *param =
(struct TLV_Peer_Termination_type *)tlv;
- uint32_t my_ip = nbr->ei->address->u.prefix4.s_addr;
+ uint32_t my_ip = nbr->ei->address.u.prefix4.s_addr;
uint32_t received_ip = param->neighbor_ip;
if (my_ip == received_ip) {
/* Set zebra interface pointer. */
ei->ifp = ifp;
- ei->address = p;
+ prefix_copy(&ei->address, p);
ifp->info = ei;
listnode_add(eigrp->eiflist, ei);
struct prefix dest_addr;
- dest_addr = *ei->address;
+ dest_addr = ei->address;
apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
&dest_addr);
/* The interface should belong to the EIGRP-all-routers group.
*/
if (!ei->member_allrouters
- && (eigrp_if_add_allspfrouters(ei->eigrp, ei->address,
+ && (eigrp_if_add_allspfrouters(ei->eigrp, &ei->address,
ei->ifp->ifindex)
>= 0))
/* Set the flag only if the system call to join
* group. */
if (ei->member_allrouters) {
/* Only actually drop if this is the last reference */
- eigrp_if_drop_allspfrouters(ei->eigrp, ei->address,
+ eigrp_if_drop_allspfrouters(ei->eigrp, &ei->address,
ei->ifp->ifindex);
/* Unset the flag regardless of whether the system call
to leave
eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
}
- dest_addr = *ei->address;
+ dest_addr = ei->address;
apply_mask(&dest_addr);
pe = eigrp_topology_table_lookup_ipv4(eigrp->topology_table,
&dest_addr);
if (ifp && ei->ifp != ifp)
continue;
- if (IPV4_ADDR_SAME(&address, &ei->address->u.prefix4))
+ if (IPV4_ADDR_SAME(&address, &ei->address.u.prefix4))
return ei;
}
if (rn->info == NULL)
continue;
- if (eigrp_network_match_iface(ei->address, &rn->p)) {
+ if (eigrp_network_match_iface(&ei->address, &rn->p)) {
found = true;
route_unlock_node(rn);
break;
return 0;
}
- inet_ntop(AF_INET, &ei->address->u.prefix4, source_ip, PREFIX_STRLEN);
+ inet_ntop(AF_INET, &ei->address.u.prefix4, source_ip, PREFIX_STRLEN);
memset(&ctx, 0, sizeof(ctx));
buffer[0] = '\n';
}
if (ep->dst.s_addr == htonl(EIGRP_MULTICAST_ADDRESS))
- eigrp_if_ipmulticast(eigrp, ei->address, ei->ifp->ifindex);
+ eigrp_if_ipmulticast(eigrp, &ei->address, ei->ifp->ifindex);
memset(&iph, 0, sizeof(struct ip));
memset(&sa_dst, 0, sizeof(sa_dst));
iph.ip_ttl = EIGRP_IP_TTL;
iph.ip_p = IPPROTO_EIGRPIGP;
iph.ip_sum = 0;
- iph.ip_src.s_addr = ei->address->u.prefix4.s_addr;
+ iph.ip_src.s_addr = ei->address.u.prefix4.s_addr;
iph.ip_dst.s_addr = ep->dst.s_addr;
memset(&msg, 0, sizeof(msg));
/* Self-originated packet should be discarded silently. */
if (eigrp_if_lookup_by_local_addr(eigrp, NULL, iph->ip_src)
- || (IPV4_ADDR_SAME(&iph->ip_src, &ei->address->u.prefix4))) {
+ || (IPV4_ADDR_SAME(&iph->ip_src, &ei->address.u.prefix4))) {
if (IS_DEBUG_EIGRP_TRANSMIT(0, RECV))
zlog_debug(
"eigrp_read[%s]: Dropping self-originated packet",
sizeof(buf[0])),
inet_ntop(AF_INET, &iph->ip_dst, buf[1],
sizeof(buf[1])),
- inet_ntop(AF_INET, &ei->address->u.prefix4,
+ inet_ntop(AF_INET, &ei->address.u.prefix4,
buf[2], sizeof(buf[2])));
if (iph->ip_dst.s_addr == htonl(EIGRP_MULTICAST_ADDRESS)) {
if (ei->type == EIGRP_IFTYPE_POINTOPOINT)
return 1;
- masklen2ip(ei->address->prefixlen, &mask);
+ masklen2ip(ei->address.prefixlen, &mask);
- me.s_addr = ei->address->u.prefix4.s_addr & mask.s_addr;
+ me.s_addr = ei->address.u.prefix4.s_addr & mask.s_addr;
him.s_addr = ip_src.s_addr & mask.s_addr;
if (IPV4_ADDR_SAME(&me, &him))
/* EIGRP Network Type. */
uint8_t type;
- struct prefix *address; /* Interface prefix */
+ struct prefix address; /* Interface prefix */
/* Neighbor information. */
struct list *nbrs; /* EIGRP Neighbor List */