]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/802/tr.c
[PATCH] ext4 balloc: fix off-by-one against grp_goal
[linux-2.6-omap-h63xx.git] / net / 802 / tr.c
index 1eaa3d19d8bf760b19b57d2a6b5556de677dd0cb..829deb41ce81d436aad10567d03d35ca86532b58 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -165,7 +164,7 @@ static int tr_rebuild_header(struct sk_buff *skb)
         */
         
        if(trllc->ethertype != htons(ETH_P_IP)) {
-               printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n",(unsigned int)htons(trllc->ethertype));
+               printk("tr_rebuild_header: Don't know how to resolve type %04X addresses ?\n", ntohs(trllc->ethertype));
                return 0;
        }
 
@@ -187,7 +186,7 @@ static int tr_rebuild_header(struct sk_buff *skb)
  *     it via SNAP.
  */
  
-unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev) 
+__be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
 {
 
        struct trh_hdr *trh=(struct trh_hdr *)skb->data;
@@ -230,15 +229,15 @@ unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev)
         */
 
        if (trllc->dsap == EXTENDED_SAP &&
-           (trllc->ethertype == ntohs(ETH_P_IP) ||
-            trllc->ethertype == ntohs(ETH_P_IPV6) ||
-            trllc->ethertype == ntohs(ETH_P_ARP)))
+           (trllc->ethertype == htons(ETH_P_IP) ||
+            trllc->ethertype == htons(ETH_P_IPV6) ||
+            trllc->ethertype == htons(ETH_P_ARP)))
        {
                skb_pull(skb, sizeof(struct trllc));
                return trllc->ethertype;
        }
 
-       return ntohs(ETH_P_TR_802_2);
+       return htons(ETH_P_TR_802_2);
 }
 
 /*
@@ -340,9 +339,10 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
        unsigned int hash, rii_p = 0;
        unsigned long flags;
        struct rif_cache *entry;
-
+       unsigned char saddr0;
 
        spin_lock_irqsave(&rif_lock, flags);
+       saddr0 = trh->saddr[0];
        
        /*
         *      Firstly see if the entry exists
@@ -395,7 +395,6 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
                        entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
                        memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
                        entry->local_ring = 0;
-                       trh->saddr[0]|=TR_RII; /* put the routing indicator back for tcpdump */
                }
                else
                {
@@ -422,6 +421,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n",
                    }                                         
                entry->last_used=jiffies;               
        }
+       trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */
        spin_unlock_irqrestore(&rif_lock, flags);
 }
 
@@ -642,6 +642,5 @@ static int __init rif_init(void)
 
 module_init(rif_init);
 
-EXPORT_SYMBOL(tr_source_route);
 EXPORT_SYMBOL(tr_type_trans);
 EXPORT_SYMBOL(alloc_trdev);