diff options
author | wollman <wollman@FreeBSD.org> | 1995-03-16 16:25:55 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-03-16 16:25:55 +0000 |
commit | b6beceae27e1650af0e5a1ee94bb83a629d6530a (patch) | |
tree | d878fa17c7db5f8fb8d5da16fdf99ebdb6f5e3f4 /sys/netinet/raw_ip.c | |
parent | 965da3c27aad8b8260f2d9f4b1b580a4da6c1e04 (diff) | |
download | FreeBSD-src-b6beceae27e1650af0e5a1ee94bb83a629d6530a.zip FreeBSD-src-b6beceae27e1650af0e5a1ee94bb83a629d6530a.tar.gz |
This set of patches enables IP multicasting to work under FreeBSD. I am
submitting them as context diffs for the following files:
sys/netinet/ip_mroute.c
sys/netinet/ip_var.h
sys/netinet/raw_ip.c
usr.sbin/mrouted/igmp.c
usr.sbin/mrouted/prune.c
The routine rip_ip_input in raw_ip.c is suggested by Mark Tinguely
(tinguely@plains.nodak.edu). I have been running mrouted with these patches
for over a week and nothing has seemed seriously wrong. It is being run in
two places on our network as a tunnel on one and a subnet querier on the
other. The only problem I have run into is that mrouted on the tunnel must
start up last or the pruning isn't done correctly and multicast packets
flood your subnets.
Submitted by: Soochon Radee <slr@mitre.org>
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 4fcc900..95fe7a6 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.2 (Berkeley) 1/4/94 - * $Id: raw_ip.c,v 1.14 1995/02/07 02:53:14 wollman Exp $ + * $Id: raw_ip.c,v 1.15 1995/02/14 06:24:40 phk Exp $ */ #include <sys/param.h> @@ -96,10 +96,10 @@ rip_input(m) if (inp->inp_ip.ip_p && inp->inp_ip.ip_p != ip->ip_p) continue; if (inp->inp_laddr.s_addr && - inp->inp_laddr.s_addr == ip->ip_dst.s_addr) + inp->inp_laddr.s_addr != ip->ip_dst.s_addr) continue; if (inp->inp_faddr.s_addr && - inp->inp_faddr.s_addr == ip->ip_src.s_addr) + inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; if (last) { struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); @@ -123,6 +123,27 @@ rip_input(m) sorwakeup(last); } else { m_freem(m); + ipstat.ips_noproto++; + ipstat.ips_delivered--; + } +} + +void rip_ip_input(mm, ip_mrouter, src) + struct mbuf *mm; + register struct socket *ip_mrouter; + struct sockaddr *src; +{ + if (ip_mrouter) + { + if (sbappendaddr(&ip_mrouter->so_rcv, src, + mm, (struct mbuf *) 0) == 0) + m_freem(mm); + else + sorwakeup(ip_mrouter); + } + else + { + m_freem(mm); ipstat.ips_noproto++; ipstat.ips_delivered--; } |