[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-vlan
Subject:    [VLAN] macvlan compile problem
From:       "Kashyap Ashwin" <Ashwin.Kashyap () thomson ! net>
Date:       2003-12-10 22:16:22
[Download RAW message or body]

--===============19563840920200759==
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C3BF6B.3E5BBC48"

This is a multi-part message in MIME format.


Hi,
I am using redhat 7.2 with gcc 2.96 and gcc gets confused some variable \
initialization. This patch fixes it. Please apply.
 
--- macvlan.c.orig      Wed Dec 10 18:09:17 2003
+++ macvlan.c   Wed Dec 10 17:28:25 2003
@@ -833,7 +833,8 @@
         * take the bottom source address byte
         */
        struct macvlan_hash_entry *entry;
-       unsigned int bucket = VLAN_BUCKET(src);
+       unsigned int bucket;
+       bucket = VLAN_BUCKET(src);
        for (entry = port->hash_table[bucket]; entry; entry = entry->next) {
                if (memcmp(entry->mac, src, ETH_ALEN) == 0) {
                        /*DEBUG("macvlan: matched %02x:%02x:%02x:%02x:%02x:%02x to \
vlan %p\n",  @@ -850,10 +851,11 @@
 
        struct macvlan_port *port;
        struct macvlan_vlan *vlan;
-       unsigned int bucket = VLAN_BUCKET(macaddr);
+       unsigned int bucket;
        struct macvlan_hash_entry* entry;
 
 
+       bucket = VLAN_BUCKET(macaddr);
        /* find the port in question */
        port = macvlan_find_port_for_mvlan_ifname(ifname);
        if (!port) {
@@ -905,10 +907,12 @@
 /* cleans up the mac hash entry memory (kfree). */
 static int macvlan_hash_rem(const char* vlan_ifname,
                            const unsigned char* mac) {
-       int bucket = VLAN_BUCKET(mac);
+       int bucket;
        struct macvlan_port *port;
        struct macvlan_hash_entry *entry;
        struct macvlan_hash_entry* prev;
+
+       bucket = VLAN_BUCKET(mac);
            
        /* find the port in question */
        port = macvlan_find_port_for_mvlan_ifname(vlan_ifname);

 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            \|/ ____ \|/ 

Ashwin Kashyap                                   @~/ ,. \~@ 

Intern                                          /_( \__/ )_\ 

Thomson - Corporate Research                       \__U_/ 

(609) 987-7334                                  Don't Panic!
 


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=877581222-10122003><FONT face=Arial 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=877581222-10122003><FONT face=Arial size=2>I am using redhat 
7.2 with gcc 2.96 and gcc gets confused some variable initialization. This patch 
fixes it.</FONT></SPAN></DIV>
<DIV><SPAN class=877581222-10122003><FONT face=Arial size=2>Please 
apply.</FONT></SPAN></DIV>
<DIV><SPAN class=877581222-10122003><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=877581222-10122003><FONT face=Arial size=2>--- 
macvlan.c.orig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Wed Dec 10 18:09:17 2003<BR>+++ 
macvlan.c&nbsp;&nbsp; Wed Dec 10 17:28:25 2003<BR>@@ -833,7 +833,8 
@@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * take the bottom source 
address byte<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct macvlan_hash_entry 
*entry;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int bucket = 
VLAN_BUCKET(src);<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int 
bucket;<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bucket = 
VLAN_BUCKET(src);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (entry = 
port-&gt;hash_table[bucket]; entry; entry = entry-&gt;next) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 if (memcmp(entry-&gt;mac, src, ETH_ALEN) == 0) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 /*DEBUG("macvlan: matched %02x:%02x:%02x:%02x:%02x:%02x to vlan %p\n", <BR>@@ 
-850,10 +851,11 @@<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
struct macvlan_port *port;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct 
macvlan_vlan *vlan;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int bucket 
= VLAN_BUCKET(macaddr);<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned int 
bucket;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct macvlan_hash_entry* 
entry;<BR>&nbsp;<BR>&nbsp;<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bucket = 
VLAN_BUCKET(macaddr);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* find the 
port in question */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port = 
macvlan_find_port_for_mvlan_ifname(ifname);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 if (!port) {<BR>@@ -905,10 +907,12 @@<BR>&nbsp;/* cleans up the mac hash entry 
memory (kfree). */<BR>&nbsp;static int macvlan_hash_rem(const char* 
vlan_ifname,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 const unsigned char* mac) {<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int bucket 
= VLAN_BUCKET(mac);<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int 
bucket;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct macvlan_port 
*port;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct macvlan_hash_entry 
*entry;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; struct macvlan_hash_entry* 
prev;<BR>+<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bucket = 
VLAN_BUCKET(mac);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* find the port in question 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; port = 
macvlan_find_port_for_mvlan_ifname(vlan_ifname);<BR></FONT></SPAN></DIV>
<DIV><SPAN class=877581222-10122003><FONT face=Arial 
size=2>&nbsp;</DIV></FONT></SPAN><PRE>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~            \
\|/ ____ \|/  Ashwin Kashyap                                   @~/ ,. \~@ 
Intern                                          /_( \__/ )_\ 
Thomson - Corporate Research                       \__U_/ 
(609) 987-7334                                  Don't Panic!
</PRE>
<DIV>&nbsp;</DIV></BODY></HTML>



_______________________________________________
VLAN mailing list  -  VLAN@wanfear.com
http://www.WANfear.com/mailman/listinfo/vlan
VLAN Page:  http://scry.wanfear.com/~greear/vlan.html

--===============19563840920200759==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic