Lines 17-24
Link Here
|
17 |
ndproxy_start() |
17 |
ndproxy_start() |
18 |
{ |
18 |
{ |
19 |
echo "Starting ndproxy:" |
19 |
echo "Starting ndproxy:" |
20 |
if ! sysctl net.inet6.ndproxyconf_uplink_interface > /dev/null 2>&1; then |
20 |
sysctl net.inet6.ndproxyconf_uplink_interface > /dev/null 2>&1 |
21 |
if ! kldload ndproxy > /dev/null 2>&1; then |
21 |
if [ $? -eq 1 ]; then |
|
|
22 |
kldload ndproxy > /dev/null 2>&1 |
23 |
if [ $? -eq 1 ]; then |
22 |
echo Failure loading ndproxy. |
24 |
echo Failure loading ndproxy. |
23 |
return; |
25 |
return; |
24 |
fi |
26 |
fi |
Lines 26-56
Link Here
|
26 |
|
28 |
|
27 |
sysctl net.inet6.ndproxycount=0 |
29 |
sysctl net.inet6.ndproxycount=0 |
28 |
|
30 |
|
|
|
31 |
sysctl net.inet6.ndproxyconf_uplink_interface=${ndproxy_uplink_interface} |
32 |
sysctl net.inet6.ndproxyconf_downlink_mac_address=${ndproxy_downlink_mac_address} |
33 |
sysctl net.inet6.ndproxyconf_exception_ipv6_addresses=${ndproxy_exception_ipv6_addresses} |
34 |
sysctl net.inet6.ndproxyconf_uplink_ipv6_addresses=${ndproxy_uplink_ipv6_addresses} |
35 |
|
29 |
if [ -z "${ndproxy_uplink_interface}" ]; then |
36 |
if [ -z "${ndproxy_uplink_interface}" ]; then |
30 |
echo "Warning: ndproxy_uplink_interface should be defined in rc.conf (see ndproxy(4))." |
37 |
echo "Warning: ndproxy_uplink_interface should be defined in rc.conf (see ndproxy(4))." |
31 |
fi |
38 |
fi |
32 |
sysctl net.inet6.ndproxyconf_uplink_interface=${ndproxy_uplink_interface} |
|
|
33 |
|
39 |
|
34 |
if [ -z "${ndproxy_downlink_mac_address}" ]; then |
40 |
if [ -z "${ndproxy_downlink_mac_address}" ]; then |
35 |
echo "Warning: ndproxy_downlink_mac_address should be defined in rc.conf (see ndproxy(4))." |
41 |
echo "Warning: ndproxy_downlink_mac_address should be defined in rc.conf (see ndproxy(4))." |
36 |
fi |
42 |
fi |
37 |
sysctl net.inet6.ndproxyconf_downlink_mac_address=${ndproxy_downlink_mac_address} |
|
|
38 |
|
43 |
|
39 |
if [ -z "${ndproxy_uplink_ipv6_addresses}" ]; then |
44 |
if [ -z "${ndproxy_uplink_ipv6_addresses}" ]; then |
40 |
echo "Warning: ndproxy_uplink_ipv6_addresses should be defined in rc.conf (see ndproxy(4))." |
45 |
echo "Warning: ndproxy_uplink_ipv6_addresses should be defined in rc.conf (see ndproxy(4))." |
41 |
fi |
46 |
fi |
42 |
sysctl net.inet6.ndproxyconf_exception_ipv6_addresses=${ndproxy_exception_ipv6_addresses} |
|
|
43 |
|
47 |
|
44 |
# Note that ndproxy_exception_ipv6_addresses may be left empty. |
48 |
# Note that ndproxy_exception_ipv6_addresses may be left empty. |
45 |
|
49 |
|
46 |
if [ -n "${ndproxy_uplink_interface}" ]; then |
50 |
if [ -n "${ndproxy_uplink_interface}" ]; then |
47 |
if ! ifconfig ${ndproxy_uplink_interface} | head -1 | grep -q PPROMISC; then |
51 |
ifconfig ${ndproxy_uplink_interface} | head -1 | grep PPROMISC > /dev/null |
|
|
52 |
if [ $? -eq 1 ]; then |
48 |
echo "Putting interface ${ndproxy_uplink_interface} into permanently promiscuous mode." |
53 |
echo "Putting interface ${ndproxy_uplink_interface} into permanently promiscuous mode." |
49 |
ifconfig ${ndproxy_uplink_interface} promisc |
54 |
ifconfig ${ndproxy_uplink_interface} promisc |
50 |
fi |
55 |
fi |
51 |
fi |
56 |
fi |
52 |
sysctl net.inet6.ndproxyconf_uplink_ipv6_addresses=${ndproxy_uplink_ipv6_addresses} |
57 |
|
53 |
|
|
|
54 |
echo Done. |
58 |
echo Done. |
55 |
} |
59 |
} |
56 |
|
60 |
|
Lines 58-67
Link Here
|
58 |
{ |
62 |
{ |
59 |
echo "Stopping ndproxy:" |
63 |
echo "Stopping ndproxy:" |
60 |
|
64 |
|
61 |
if ! sysctl net.inet6.ndproxyconf_uplink_interface > /dev/null 2>&1; then |
65 |
sysctl net.inet6.ndproxyconf_uplink_interface > /dev/null 2>&1 |
|
|
66 |
if [ $? -eq 1 ]; then |
62 |
echo Failure unloading ndproxy. |
67 |
echo Failure unloading ndproxy. |
63 |
else |
68 |
else |
64 |
if ! kldunload ndproxy > /dev/null 2>&1; then |
69 |
kldunload ndproxy > /dev/null 2>&1 |
|
|
70 |
if [ $? -eq 1 ]; then |
65 |
echo Failure unloading ndproxy. |
71 |
echo Failure unloading ndproxy. |
66 |
else |
72 |
else |
67 |
echo Done. |
73 |
echo Done. |