firewall.py: MacOS: permanently set the net.inet.ip.scopedroute sysctl.
firewall.py: MacOS: permanently set the net.inet.ip.scopedroute sysctl.

If this sysctl isn't set to 0 at the time your network interface is brought
up, and we later change it, then the MacOS (10.6.6 at least) ARP table gets
totally confused and networking stops working about 15 minutes later, until
you down and re-up the interface.  The symptom is that pings outside your
LAN would give results like this:

    ping: sendto: no route to host

and "arp -a -n" would show *two* entries for your default gateway instead of
just one.

sshuttle was helpfully putting the sysctl back the way it was when it shuts
down, so you would fix your network by downing the interface, so sshuttle
would abort and change the sysctl back, then you would re-up the interface,
then restart sshuttle, and sshuttle would change the sysctl back and restart
the cycle: it would break again a few minutes later.

That's annoying, and it gives sshuttle a bad reputation for being the thing
that breaks your network.  I can't find a *really* good workaround for the
bug, so barring that, let's just permanently set the sysctl to 0 and not
change it back on exit.  That should just leave your computer back how it
worked in MacOS 10.5, as far as I know, which seems harmless.  At least I've
been running my Mac that way for a few days and I haven't seen any
weirdness.

Now, doing *that* would still mean that the first sshuttle session after a
reboot would still break the network, since sysctl changes are lost on
reboot.  Thus, let's be extra hardcore and write it to /etc/sysctl.conf so
that it goes the way we want it after a reboot.  Thus, sshuttle should break
your network at most once.  Which still sucks, but hopefully nobody will
notice.

xtaran/sshuttle,brianmay/sshuttle,brianmay/sshuttle,sekka1/sshuttle,sshuttle/sshuttle,fastly/sshuttle,luthfihm/sshuttle,dushmis/sshuttle,sshuttle/sshuttle,guiquanz/sshuttle,bitmonk/sshuttle,shaunstanislaus/sshuttle,cgundogan/sshuttle,GrimDerp/sshuttle,mheiges/sshuttle,xtaran/sshuttle,v2e4lisp/sshuttle,brianmay/sshuttle,michaelcontento/sshuttle,shaunstanislaus/sshuttle,guiquanz/sshuttle,ru-faraon/sshuttle,apenwarr/sshuttle,vStone/sshuttle,zabracks/sshuttle,luthfihm/sshuttle,dxq-git/sshuttle,CasparLi/sshuttle,fastly/sshuttle,luthfihm/sshuttle,ru-faraon/sshuttle,dxq-git/sshuttle,loadlj/sshuttle,brianmay/sshuttle,xtaran/sshuttle,mralexgray/sshuttle,bitmonk/sshuttle,fastly/sshuttle,dushmis/sshuttle,zabracks/sshuttle,zabracks/sshuttle,CasparLi/sshuttle,v2e4lisp/sshuttle,bitmonk/sshuttle,dxq-git/sshuttle,cgundogan/sshuttle,michaelcontento/sshuttle,guiquanz/sshuttle,sekka1/sshuttle,michaelcontento/sshuttle,sekka1/sshuttle,CasparLi/sshuttle,mralexgray/sshuttle,loadlj/sshuttle,mralexgray/sshuttle,shaunstanislaus/sshuttle,GrimDerp/sshuttle,vStone/sshuttle,mheiges/sshuttle,vStone/sshuttle,GrimDerp/sshuttle,cgundogan/sshuttle,mheiges/sshuttle,loadlj/sshuttle,v2e4lisp/sshuttle,ru-faraon/sshuttle,dushmis/sshuttle,apenwarr/sshuttle