From e645a1ca2722b460ff0c8b6b7c7925f7c9cac110 Mon Sep 17 00:00:00 2001 From: Kenjiro Cho Date: Sun, 17 Sep 2000 13:50:12 +0000 Subject: [PATCH] change the evaluation order of the rsvp socket in rsvp_input() in favor of the new-style per-vif socket. this does not affect the behavior of the ISI rsvpd but allows another rsvp implementation (e.g., KOM rsvp) to take advantage of the new style for particular sockets while using the old style for others. in the future, rsvp supporn should be replaced by more generic router-alert support. PR: kern/20984 Submitted by: Martin Karsten Reviewed by: kjc --- sys/netinet/ip_mroute.c | 52 ++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 1d165f5e798..d1122b1327a 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -2145,16 +2145,6 @@ rsvp_input(m, off, proto) return; } - /* If the old-style non-vif-associated socket is set, then use - * it and ignore the new ones. - */ - if (ip_rsvpd != NULL) { - if (rsvpdebug) - printf("rsvp_input: Sending packet up old-style socket\n"); - rip_input(m, off, proto); /* xxx */ - return; - } - s = splnet(); if (rsvpdebug) @@ -2167,32 +2157,30 @@ rsvp_input(m, off, proto) ifp = m->m_pkthdr.rcvif; /* Find which vif the packet arrived on. */ - for (vifi = 0; vifi < numvifs; vifi++) { + for (vifi = 0; vifi < numvifs; vifi++) if (viftable[vifi].v_ifp == ifp) - break; - } - - if (vifi == numvifs) { - /* Can't find vif packet arrived on. Drop packet. */ - if (rsvpdebug) - printf("rsvp_input: Can't find vif for packet...dropping it.\n"); - m_freem(m); + break; + + if (vifi == numvifs || viftable[vifi].v_rsvpd == NULL) { + /* + * If the old-style non-vif-associated socket is set, + * then use it. Otherwise, drop packet since there + * is no specific socket for this vif. + */ + if (ip_rsvpd != NULL) { + if (rsvpdebug) + printf("rsvp_input: Sending packet up old-style socket\n"); + rip_input(m, off, proto); /* xxx */ + } else { + if (rsvpdebug && vifi == numvifs) + printf("rsvp_input: Can't find vif for packet.\n"); + else if (rsvpdebug && viftable[vifi].v_rsvpd == NULL) + printf("rsvp_input: No socket defined for vif %d\n",vifi); + m_freem(m); + } splx(s); return; } - - if (rsvpdebug) - printf("rsvp_input: check socket\n"); - - if (viftable[vifi].v_rsvpd == NULL) { - /* drop packet, since there is no specific socket for this - * interface */ - if (rsvpdebug) - printf("rsvp_input: No socket defined for vif %d\n",vifi); - m_freem(m); - splx(s); - return; - } rsvp_src.sin_addr = ip->ip_src; if (rsvpdebug && m)