Re: [PATCH 5/5] Add missing LAYER2 and PORTNO handling for s390x.

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

 



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

On Fri, 3 Jul 2009, Steffen Maier wrote:

comments inline

On 07/03/2009 08:39 AM, David Cantrell wrote:
libisys and loader lacked handling for the LAYER2 and PORTNO settings
present on s390x systems.

Also include the fix for #468755 to write layer2=1 rather than layer=2
to the ifcfg-DEVICE file.

Also include the fix for #471101 to include ARP=no when the device type
is qeth and there are subchannels.
---
 isys/iface.c    |    2 ++
 isys/iface.h    |    2 ++
 loader/loader.c |    4 ++++
 loader/loader.h |    2 +-
 loader/net.c    |   42 +++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/isys/iface.c b/isys/iface.c
index e139e74..c1251be 100644

diff --git a/isys/iface.h b/isys/iface.h
index f678932..3f97935 100644

diff --git a/loader/loader.c b/loader/loader.c
index 1de7019..71829e6 100644

diff --git a/loader/loader.h b/loader/loader.h
index a6e2d05..a38bd49 100644

diff --git a/loader/net.c b/loader/net.c
index 5b9593a..d56a040 100644

above hunks look good

@@ -1193,7 +1201,7 @@ int writeDisabledNetInfo(void) {
  *     /etc/sysconfig/network
  */
 int writeEnabledNetInfo(iface_t *iface) {
-    int i = 0;
+    int i = 0, osa_layer2 = 1, osa_portno = 0;
     mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
     FILE *fp = NULL;
     char buf[INET6_ADDRSTRLEN+1];
@@ -1403,6 +1411,38 @@ int writeEnabledNetInfo(iface_t *iface) {
         fprintf(fp, "CTCPROT=%s\n", iface->ctcprot);
     }

+    if (iface->layer2 && !strcmp(iface->layer2, "1")) {
+        osa_layer2 = 1;

+    } else if (iface->subchannels && !strcmp(iface->nettype, "qeth")) {
+        fprintf(fp, "ARP=no\n");
+    }

It would probably be another changeset but since you are already
speaking of the ARP=no issue wrt LCS, I would like to mention an open
bug against RHEL 5 which should get fixed upstream:

https://bugzilla.redhat.com/show_bug.cgi?id=491144
IPv6 on OSA in layer3 mode does not work since ARP=no was written to
ifcfg-eth0
(especially comments 12 and 16 for a thorough analysis and explanation)
There is some more background information in two kbases for RHEL 5:
http://kbase.redhat.com/faq/docs/DOC-16784
http://kbase.redhat.com/faq/docs/DOC-16786

Writing ARP=no for qeth has always been a hack and breaks IPv6 on qeth
devices in layer 3 mode. For the oldest z/VM version still supported
there has been a fix since 2007 which obsoletes the ARP=no hack. For all
newer z/VM versions the fix is already included. In other words, the
noarp hack is no longer necessary especially since it breaks IPv6.

We should remove the writing of ARP=no entirely from anaconda.

Done.  Removed the block that writes ARP=no in the patch.  Updated version
below:


diff --git a/isys/iface.c b/isys/iface.c
index e139e74..c1251be 100644
- --- a/isys/iface.c
+++ b/isys/iface.c
@@ -381,6 +381,8 @@ void iface_init_iface_t(iface_t *iface) {
     iface->peerid = NULL;
     iface->nettype = NULL;
     iface->ctcprot = NULL;
+    iface->layer2 = NULL;
+    iface->portno = NULL;
     iface->flags = 0;
     iface->ipv4method = IPV4_UNUSED_METHOD;
     iface->ipv6method = IPV6_UNUSED_METHOD;
diff --git a/isys/iface.h b/isys/iface.h
index f678932..3f97935 100644
- --- a/isys/iface.h
+++ b/isys/iface.h
@@ -95,6 +95,8 @@ typedef struct _iface_t {
     char *peerid;
     char *nettype;
     char *ctcprot;
+    char *layer2;
+    char *portno;

     /* flags */
     uint64_t flags;
diff --git a/loader/loader.c b/loader/loader.c
index 1de7019..71829e6 100644
- --- a/loader/loader.c
+++ b/loader/loader.c
@@ -684,6 +684,7 @@ static void readNetInfo(struct loaderData_s ** ld) {
     loaderData->nettype = NULL;
     loaderData->ctcprot = NULL;
     loaderData->layer2 = NULL;
+    loaderData->portno = NULL;
     loaderData->macaddr = NULL;

     /*
@@ -753,6 +754,9 @@ static void readNetInfo(struct loaderData_s ** ld) {
             if (!strncmp(vname, "LAYER2", 6))
                 loaderData->layer2 = strdup(vparm);

+            if (!strncmp(vname, "PORTNO", 6))
+                loaderData->portno = strdup(vparm);
+
             if (!strncmp(vname, "MACADDR", 7))
                 loaderData->macaddr = strdup(vparm);

diff --git a/loader/loader.h b/loader/loader.h
index a6e2d05..a38bd49 100644
- --- a/loader/loader.h
+++ b/loader/loader.h
@@ -126,7 +126,7 @@ struct loaderData_s {
     int bootIf_set;
     char * netCls;
     int netCls_set;
- -    char *ipv4, *netmask, *gateway, *dns, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *layer2, *macaddr;
+    char *ipv4, *netmask, *gateway, *dns, *hostname, *peerid, *ethtool, *subchannels, *portname, *essid, *wepkey, *nettype, *ctcprot, *layer2, *portno, *macaddr;
 #ifdef ENABLE_IPV6
     char *ipv6;
     int ipv6info_set;
diff --git a/loader/net.c b/loader/net.c
index 5b9593a..2da2384 100644
- --- a/loader/net.c
+++ b/loader/net.c
@@ -400,6 +400,14 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
         parseEthtoolSettings(loaderData);
     }

+    if (loaderData->layer2) {
+        iface->layer2 = strdup(loaderData->layer2);
+    }
+
+    if (loaderData->portno) {
+        iface->portno = strdup(loaderData->portno);
+    }
+
     if (loaderData->noDns) {
         iface->flags |= IFACE_FLAGS_NO_WRITE_RESOLV_CONF;
     }
@@ -1193,7 +1201,7 @@ int writeDisabledNetInfo(void) {
  *     /etc/sysconfig/network
  */
 int writeEnabledNetInfo(iface_t *iface) {
- -    int i = 0;
+    int i = 0, osa_layer2 = 1, osa_portno = 0;
     mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
     FILE *fp = NULL;
     char buf[INET6_ADDRSTRLEN+1];
@@ -1403,6 +1411,36 @@ int writeEnabledNetInfo(iface_t *iface) {
         fprintf(fp, "CTCPROT=%s\n", iface->ctcprot);
     }

+    if (iface->layer2 && !strcmp(iface->layer2, "1")) {
+        osa_layer2 = 1;
+    }
+
+    if (iface->portno && !strcmp(iface->portno, "1")) {
+        osa_portno = 1;
+    }
+
+    if (osa_layer2 || osa_portno) {
+        fprintf(fp, "OPTIONS=\"");
+
+        if (osa_layer2) {
+            fprintf(fp, "layer2=1");
+        }
+
+        if (osa_layer2 && osa_portno) {
+            fprintf(fp, " ");
+        }
+
+        if (osa_portno) {
+            fprintf(fp, "portno=1");
+        }
+
+        fprintf(fp, "\"\n");
+    }
+
+    if (iface->macaddr) {
+        fprintf(fp, "MACADDR=%s\n", iface->macaddr);
+    }
+
     if (fclose(fp) == EOF) {
         free(ofile);
         free(nfile);


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpSsC0ACgkQ5hsjjIy1VkkW8ACgqF39gZx0UJ7m/UXpF4GR3Bew
EUAAoK2pJesjiNu0Kn2HHts7P5DzWWQx
=CHL8
-----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