diff options
author | kjc <kjc@FreeBSD.org> | 2000-09-17 13:50:12 +0000 |
---|---|---|
committer | kjc <kjc@FreeBSD.org> | 2000-09-17 13:50:12 +0000 |
commit | 0a7adf329639dd531f4d9522e52363438e126fdd (patch) | |
tree | e6ac429b671b70204535f7eb30ac29b1c6e620ca /sys/netinet/ip_mroute.c | |
parent | cb69a028ad335ceefa94bfe8665549f0b3c02c06 (diff) | |
download | FreeBSD-src-0a7adf329639dd531f4d9522e52363438e126fdd.zip FreeBSD-src-0a7adf329639dd531f4d9522e52363438e126fdd.tar.gz |
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
Diffstat (limited to 'sys/netinet/ip_mroute.c')
-rw-r--r-- | sys/netinet/ip_mroute.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 1d165f5..d1122b1 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,31 +2157,29 @@ 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); - splx(s); - return; - } - - if (rsvpdebug) - printf("rsvp_input: check socket\n"); + break; - if (viftable[vifi].v_rsvpd == NULL) { - /* drop packet, since there is no specific socket for this - * interface */ + 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: No socket defined for vif %d\n",vifi); + 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; + } + splx(s); + return; } rsvp_src.sin_addr = ip->ip_src; |