From 3c63dd582cd759da83db6c8836d8a7618ed881ad Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Tue, 6 Dec 2005 17:24:19 +0000 Subject: multicast_host=YES only works if a valid default gateway is available. validate this condition and reject multicast traffic on failure. ok todd@ naddy@ --- etc/netstart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/etc/netstart b/etc/netstart index 7e4fcb4a202..d144eca6da7 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.111 2005/11/02 18:45:26 todd Exp $ +# $OpenBSD: netstart,v 1.112 2005/12/06 17:24:18 reyk Exp $ # Strip comments (and leading/trailing whitespace if IFS is set) # from a file and spew to stdout @@ -330,6 +330,7 @@ done # NO YES none installed daemon will run # YES/interface NO -interface YES=def. iface # Any other combination -reject config error +route -qn delete 224.0.0.0/4 > /dev/null 2>&1 case "$multicast_host:$multicast_router" in NO:NO) route -qn add -net 224.0.0.0/4 -interface 127.0.0.1 -reject > /dev/null @@ -337,7 +338,7 @@ NO:NO) NO:YES) ;; *:NO) - set `if [ $multicast_host = YES ]; then + maddr=`if [ "$multicast_host" = "YES" ]; then ed -s '!route -qn show -inet' < /dev/null + fi 2> /dev/null` + if [ "X${maddr}" != "X" ]; then + set $maddr + route -qn add -net 224.0.0.0/4 -interface $2 > /dev/null + else + route -qn add -net 224.0.0.0/4 -interface \ + 127.0.0.1 -reject > /dev/null + fi ;; *:*) echo 'config error, multicasting disabled until rc.conf is fixed' -- cgit v1.2.3