diff options
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 8173a25..f928744 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -600,7 +600,8 @@ pass: * ip_mforward() returns a non-zero value, the packet * must be discarded, else it may be accepted below. */ - if (ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) { + if (ip_mforward && + ip_mforward(ip, m->m_pkthdr.rcvif, m, 0) != 0) { ipstat.ips_cantforward++; m_freem(m); return; @@ -2073,10 +2074,10 @@ ip_rsvp_init(struct socket *so) { if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_RSVP) - return EOPNOTSUPP; + return EOPNOTSUPP; if (ip_rsvpd != NULL) - return EADDRINUSE; + return EADDRINUSE; ip_rsvpd = so; /* @@ -2105,3 +2106,29 @@ ip_rsvp_done(void) } return 0; } + +void +rsvp_input(struct mbuf *m, int off) /* XXX must fixup manually */ +{ + if (rsvp_input_p) { /* call the real one if loaded */ + rsvp_input_p(m, off); + return; + } + + /* Can still get packets with rsvp_on = 0 if there is a local member + * of the group to which the RSVP packet is addressed. But in this + * case we want to throw the packet away. + */ + + if (!rsvp_on) { + m_freem(m); + return; + } + + if (ip_rsvpd != NULL) { + rip_input(m, off); + return; + } + /* Drop the packet */ + m_freem(m); +} |