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 <Martin.Karsten@KOM.tu-darmstadt.de>
Reviewed by:	kjc
This commit is contained in:
Kenjiro Cho 2000-09-17 13:50:12 +00:00
parent e4bdf25dc8
commit e645a1ca27

View File

@ -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)