]> git.proxmox.com Git - mirror_frr.git/commitdiff
eigrpd: Convert eigrp_packet.c to not use VRF_DEFAULT
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 15 Jun 2019 19:24:20 +0000 (15:24 -0400)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Wed, 7 Aug 2019 01:42:31 +0000 (22:42 -0300)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_packet.c

index f10317e3e50d47e277542090554c099acb3cf455..ba8271d46e17e92ebefbde9e0ff9a6376dab749f 100644 (file)
@@ -77,11 +77,13 @@ const struct message eigrp_packet_type_str[] = {
 static unsigned char zeropad[16] = {0};
 
 /* Forward function reference*/
-static struct stream *eigrp_recv_packet(int, struct interface **,
-                                       struct stream *);
-static int eigrp_verify_header(struct stream *, struct eigrp_interface *,
-                              struct ip *, struct eigrp_header *);
-static int eigrp_check_network_mask(struct eigrp_interface *, struct in_addr);
+static struct stream *eigrp_recv_packet(struct eigrp *eigrp, int fd,
+                                       struct interface **ifp,
+                                       struct stream *s);
+static int eigrp_verify_header(struct stream *s, struct eigrp_interface *ei,
+                              struct ip *addr, struct eigrp_header *header);
+static int eigrp_check_network_mask(struct eigrp_interface *ei,
+                                   struct in_addr mask);
 
 static int eigrp_retrans_count_exceeded(struct eigrp_packet *ep,
                                        struct eigrp_neighbor *nbr)
@@ -495,7 +497,7 @@ int eigrp_read(struct thread *thread)
        thread_add_read(master, eigrp_read, eigrp, eigrp->fd, &eigrp->t_read);
 
        stream_reset(eigrp->ibuf);
-       if (!(ibuf = eigrp_recv_packet(eigrp->fd, &ifp, eigrp->ibuf))) {
+       if (!(ibuf = eigrp_recv_packet(eigrp, eigrp->fd, &ifp, eigrp->ibuf))) {
                /* This raw packet is known to be at least as big as its IP
                 * header. */
                return -1;
@@ -706,7 +708,8 @@ int eigrp_read(struct thread *thread)
        return 0;
 }
 
-static struct stream *eigrp_recv_packet(int fd, struct interface **ifp,
+static struct stream *eigrp_recv_packet(struct eigrp *eigrp,
+                                       int fd, struct interface **ifp,
                                        struct stream *ibuf)
 {
        int ret;
@@ -774,7 +777,7 @@ static struct stream *eigrp_recv_packet(int fd, struct interface **ifp,
 
        ifindex = getsockopt_ifindex(AF_INET, &msgh);
 
-       *ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
+       *ifp = if_lookup_by_index(ifindex, eigrp->vrf_id);
 
        if (ret != ip_len) {
                zlog_warn(