Browse Source

It does not make sense to insert a specific route for 224/4 when the

default one is good enough.
So merge rc.conf(8)'s 'multicast_router' and 'multicast_host' into a
single 'multicast'.  If set to YES the reject route for 224/4 is not
inserted by netstart(8).
Manual bits from jmc@
ok henning@, ajacoutot@
OPENBSD_5_9
mpi 8 years ago
parent
commit
d372622fa0
3 changed files with 13 additions and 33 deletions
  1. +9
    -28
      src/etc/netstart
  2. +2
    -3
      src/etc/rc.conf
  3. +2
    -2
      src/etc/rc.d/rc.subr

+ 9
- 28
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $OpenBSD: netstart,v 1.162 2015/11/12 23:11:11 rpe Exp $
# $OpenBSD: netstart,v 1.163 2015/12/05 18:43:12 mpi Exp $
# Turn off Strict Bourne shell mode.
set +o sh
@ -270,37 +270,18 @@ done
# Multicast routing.
#
# The routing to the 224.0.0.0/4 net is setup according to these rules:
# multicast_host multicast_router route comment
# NO NO -reject no multicast
# NO YES none installed daemon will run
# YES/interface NO -interface YES=def. iface
# Any other combination -reject config error
# multicast route comment
# NO -reject no multicast
# YES none installed daemon can run
# 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)
case $multicast in
NO)
route -qn add -net 224.0.0.0/4 -interface 127.0.0.1 -reject >/dev/null
;;
NO:YES)
YES)
;;
*:NO)
maddr=$(if [[ $multicast_host == YES ]]; then
ed -s '!route -qn show -inet' <<EOF
/^default/p
EOF
else
ed -s "!ifconfig $multicast_host" <<EOF
/^ inet /p
EOF
fi 2>/dev/null)
if [[ -n $maddr ]]; 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'
route -qn add -net 224.0.0.0/4 -interface 127.0.0.1 -reject >/dev/null
;;


+ 2
- 3
src/etc/rc.conf View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.conf,v 1.208 2015/12/05 09:55:18 jasper Exp $
# $OpenBSD: rc.conf,v 1.209 2015/12/05 18:43:12 mpi Exp $
# DO NOT EDIT THIS FILE!!
#
@ -93,8 +93,7 @@ accounting=NO # process accounting (using /var/account/acct)
# Multicast routing configuration
# Please look at netstart(8) for a detailed description if you change these
multicast_host=NO # Route all multicast packets to a single interface
multicast_router=NO # A multicast routing daemon will be run, e.g. mrouted
multicast=NO # Reject IPv4 multicast packets by default
# miscellaneous other flags
amd_master=/etc/amd/master # AMD 'master' map


+ 2
- 2
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
# $OpenBSD: rc.subr,v 1.100 2015/10/16 20:12:00 ajacoutot Exp $
# $OpenBSD: rc.subr,v 1.101 2015/12/05 18:43:12 mpi Exp $
#
# Copyright (c) 2010, 2011, 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
# Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@ -124,7 +124,7 @@ _rc_parse_conf() {
local _l _rcfile _val
set -A _allowed_keys -- \
spamd_black pf ipsec check_quotas accounting \
multicast_host multicast_router amd_master \
multicast amd_master \
shlib_dirs pkg_scripts nfs_server
[ $# -gt 0 ] || set -- /etc/rc.conf /etc/rc.conf.local


Loading…
Cancel
Save