Re: [PATCH 4/4] Disable ipv6 kernel modules if user disables IPv6 (#537887)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/06/2010 10:45 PM, dcantrell@xxxxxxxxxx wrote:
> From: David Cantrell <dcantrell@xxxxxxxxxx>
> 
> If the user passes 'noipv6' or otherwise disables IPv6 on the target
> system for all network devices, write out /etc/modprobe.d/noipv6 with
> these lines:
> 
>     # Disable IPv6 kernel modules (added by anaconda)
>     alias net-pf-10 off
>     alias ipv6 off
>     options ipv6 disable=1
> 
> Based on a patch provided in the bug, but modified so that the lines are
> written to 'noipv6' in /etc/modprobe.d rather than /etc/modprobe.conf
> and so that the file is only written out if IPv6 is disabled on all
> interfaces.
> ---
>  network.py  |   21 +++++++++++++++++++++
>  packages.py |    1 +
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/network.py b/network.py
> index 0feb8fd..b88ace9 100644
> --- a/network.py
> +++ b/network.py
> @@ -605,3 +605,24 @@ class Network:
>                  f.write("nameserver %s\n" % (ns,))
>  
>          f.close()
> +
> +        # /etc/modprobe.d/noipv6
> +        if useIPv6 == "no":
> +            d = instPath + "/etc/modprobe.d"
> +            c = d + "/noipv6"
> +            header = None
> +
> +            iutil.mkdirChain(d)
> +
> +            if os.path.isfile(c):
> +                header = "\n"
> +
> +            f = open(c, "w+")
> +            if header:
> +                f.write(header)

header and check for isfile isn't needed, since this is the first time
it has been written, and you're using "w+" which will overwrite it anyway.

- -- 
Brian C. Lane <bcl@xxxxxxxxxx>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Remember Lexington Green!

iQEVAwUBTGBBcRF+jBaO/jp/AQJ3wQf9HgV0SUmkOlXYY+3up7Wr2g327aRGFngg
Uegri5oE4FE40nncEKcVgXuMLiG1YIBDH/z2PgxGyn6N2fbqcvBHXAXR+BwR7MFg
k2PHY94uiJJa8Sg/cN0WH/w9PNQNQ3ldaVx4Ler1hG2QHHW02OkZP3yUlBVFqbeg
gdowim+i5aIj8gZipqblSaHukrIkf050OK/+Uy6OYfUaqiFIKkx96tS63uhynPi7
je5eLI7F1dyx0c2c1a7IMg/FfoMhlakgLbC/zUlp+KrZPJdZBaG5dnD/a7tUyhgr
bkFdwMYGI02fJb1pL+KB8HoMnP4P0w7hKZkxFW2iwpWmOd8jivis9A==
=nBLQ
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux