summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_packet.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-11-12 10:08:50 -0500
committerGitHub <noreply@github.com>2019-11-12 10:08:50 -0500
commitff5d5005a2f1851cf337885cb7ecb3fe11b42f6b (patch)
tree5c77e6b31b4f719b0a554cf1abeaf534f4e0640f /eigrpd/eigrp_packet.c
parent1deb86be7d49c1a9257bc9b50c052a442d990708 (diff)
parent9e030550627248c948e39d00ead09322593eefeb (diff)
Merge pull request #5313 from mjstapp/fix_bsd_addr_of_packed
ospfd,eigrpd: don't take address of packed struct member
Diffstat (limited to 'eigrpd/eigrp_packet.c')
-rw-r--r--eigrpd/eigrp_packet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
index ba8271d46e..6367ef58ab 100644
--- a/eigrpd/eigrp_packet.c
+++ b/eigrpd/eigrp_packet.c
@@ -485,7 +485,7 @@ int eigrp_read(struct thread *thread)
struct eigrp_header *eigrph;
struct interface *ifp;
struct eigrp_neighbor *nbr;
-
+ struct in_addr srcaddr;
uint16_t opcode = 0;
uint16_t length = 0;
@@ -511,6 +511,7 @@ int eigrp_read(struct thread *thread)
if (iph->ip_v == 4)
length = (iph->ip_len) - 20U;
+ srcaddr = iph->ip_src;
/* IP Header dump. */
if (IS_DEBUG_EIGRP_TRANSMIT(0, RECV)
@@ -526,7 +527,7 @@ int eigrp_read(struct thread *thread)
and also platforms (such as Solaris 8) that claim to support
ifindex
retrieval but do not. */
- c = if_lookup_address((void *)&iph->ip_src, AF_INET,
+ c = if_lookup_address((void *)&srcaddr, AF_INET,
eigrp->vrf_id);
if (c == NULL)
@@ -549,11 +550,11 @@ int eigrp_read(struct thread *thread)
/* 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(&srcaddr, &ei->address.u.prefix4))) {
if (IS_DEBUG_EIGRP_TRANSMIT(0, RECV))
zlog_debug(
"eigrp_read[%s]: Dropping self-originated packet",
- inet_ntoa(iph->ip_src));
+ inet_ntoa(srcaddr));
return 0;
}