]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.0.39pre3 2.0.39pre3
authorDavid Weinehall <tao@acc.umu.se>
Fri, 23 Nov 2007 20:12:19 +0000 (15:12 -0500)
committerDavid Weinehall <tao@acc.umu.se>
Fri, 23 Nov 2007 20:12:19 +0000 (15:12 -0500)
o Fixed Config.in bugs in (Marc Martinez)
drivers/net and drivers/isdn
o int to (s)size_t in fs/proc/mem.c (Michal Jaegermann)
o Added IPX-routing of NetBIOS packages (Jan Rafaj)

drivers/isdn/Config.in
drivers/net/Config.in
fs/proc/mem.c
net/ipx/af_ipx.c

index d55ad472b16e114a169cfbd1963628efac22dae1..807f21c9d7acb74c5a600e309a9c47128547530e 100644 (file)
@@ -44,7 +44,7 @@ if [ "$CONFIG_ISDN_DRV_HISAX" != "n" ]; then
    bool '  HiSax Support for MIC card' CONFIG_HISAX_MIC
    bool '  HiSax Support for NETjet card' CONFIG_HISAX_NETJET
    bool '  HiSax Support for Niccy PnP/PCI card' CONFIG_HISAX_NICCY
-i
+fi
 if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
    dep_tristate '  Spellcaster support (EXPERIMENTAL)' CONFIG_ISDN_DRV_SC $CONFIG_ISDN
 fi
index 9362131232a2bf084de3888d19f16a26e1cc28f0..48b4297e6f8258b71340e360c0cd304ded898588 100644 (file)
@@ -37,6 +37,7 @@ if [ "$CONFIG_NET_RADIO" != "n" ]; then
         bool '    Soundmodem support for 4800 baud HAPN-1 modulation' CONFIG_SOUNDMODEM_HAPN4800
         bool '    Soundmodem support for 4800 baud PSK modulation' CONFIG_SOUNDMODEM_PSK4800
         bool '    Soundmodem support for 9600 baud FSK G3RUH modulation' CONFIG_SOUNDMODEM_FSK9600
+      fi
    fi
    tristate '  Serial port KISS driver for AX.25' CONFIG_MKISS
    tristate '  BPQ Ethernet driver for AX.25' CONFIG_BPQETHER
index 668220e5c4905987450373acd0098f02d0b7f7e3..2b9fb9ac6bdc804f243681e0d0eea2f6ef04b4cf 100644 (file)
 
 /*
  * mem_write isn't really a good idea right now. It needs
- * to check a lot more: if the process we try to write to 
+ * to check a lot more: if the process we try to write to
  * dies in the middle right now, mem_write will overwrite
  * kernel memory.. This disables it altogether.
  */
 #define mem_write NULL
 
-static int check_range(struct mm_struct * mm, unsigned long addr, int count)
+static ssize_t check_range(struct mm_struct * mm, unsigned long addr,
+                          size_t count)
 {
        struct vm_area_struct *vma;
-       int retval;
+       ssize_t retval;
 
        vma = find_vma(mm, addr);
        if (!vma)
@@ -76,7 +77,8 @@ static struct task_struct * get_task(int pid)
        return tsk;
 }
 
-static int mem_read(struct inode * inode, struct file * file,char * buf, int count)
+static ssize_t mem_read(struct inode * inode, struct file * file,
+                       char * buf, size_t count)
 {
        pgd_t *page_dir;
        pmd_t *page_middle;
@@ -85,7 +87,7 @@ static int mem_read(struct inode * inode, struct file * file,char * buf, int cou
        struct task_struct * tsk;
        unsigned long addr;
        char *tmp;
-       int i;
+       ssize_t scount, i;
 
        if (count < 0)
                return -EINVAL;
@@ -93,11 +95,11 @@ static int mem_read(struct inode * inode, struct file * file,char * buf, int cou
        if (!tsk)
                return -ESRCH;
        addr = file->f_pos;
-       count = check_range(tsk->mm, addr, count);
-       if (count < 0)
-               return count;
+       scount = check_range(tsk->mm, addr, count);
+       if (scount < 0)
+               return scount;
        tmp = buf;
-       while (count > 0) {
+       while (scount > 0) {
                if (current->signal & ~current->blocked)
                        break;
                page_dir = pgd_offset(tsk->mm,addr);
@@ -121,12 +123,12 @@ static int mem_read(struct inode * inode, struct file * file,char * buf, int cou
                        break;
                page = (char *) pte_page(pte) + (addr & ~PAGE_MASK);
                i = PAGE_SIZE-(addr & ~PAGE_MASK);
-               if (i > count)
-                       i = count;
+               if (i > scount)
+                       i = scount;
                memcpy_tofs(tmp, page, i);
                addr += i;
                tmp += i;
-               count -= i;
+               scount -= i;
        }
        file->f_pos = addr;
        return tmp-buf;
@@ -134,7 +136,8 @@ static int mem_read(struct inode * inode, struct file * file,char * buf, int cou
 
 #ifndef mem_write
 
-static int mem_write(struct inode * inode, struct file * file,char * buf, int count)
+static ssize_t mem_write(struct inode * inode, struct file * file,
+                        char * buf, ssize_t count)
 {
        pgd_t *page_dir;
        pmd_t *page_middle;
@@ -143,7 +146,7 @@ static int mem_write(struct inode * inode, struct file * file,char * buf, int co
        struct task_struct * tsk;
        unsigned long addr;
        char *tmp;
-       int i;
+       ssize_t i;
 
        if (count < 0)
                return -EINVAL;
@@ -195,7 +198,8 @@ static int mem_write(struct inode * inode, struct file * file,char * buf, int co
 
 #endif
 
-static int mem_lseek(struct inode * inode, struct file * file, off_t offset, int orig)
+static off_t mem_lseek(struct inode * inode, struct file * file,
+                      off_t offset, int orig)
 {
        switch (orig) {
                case 0:
index d4d2628076d2862f1c8e868cc1ab8c83baac6243..17eb63607a08cfb021afd3694a76e89763aa3078 100644 (file)
@@ -2,7 +2,7 @@
  *     Implements an IPX socket layer (badly - but I'm working on it).
  *
  *     This code is derived from work by
- *             Ross Biro       :       Writing the original IP stack
+ *             Ross Biro       :       Writing the original IP stack
  *             Fred Van Kempen :       Tidying up the TCP/IP
  *
  *     Many thanks go to Keith Baker, Institute For Industrial Information
  *     work I am currently employed to do there.
  *
  *     All the material in this file is subject to the Gnu license version 2.
- *     Neither Alan Cox nor the Swansea University Computer Society admit liability
- *     nor provide warranty for any of this software. This material is provided 
- *     as is and at no charge.         
+ *     Neither Alan Cox nor the Swansea University Computer Society admit
+ *     liability nor provide warranty for any of this software. This material
+ *     is provided as is and at no charge.
  *
- *     Revision 0.21:  Uses the new generic socket option code.
+ *     Revision 0.21:  Uses the new generic socket option code
  *     Revision 0.22:  Gcc clean ups and drop out device registration. Use the
- *                     new multi-protocol edition of hard_header 
- *     Revision 0.23:  IPX /proc by Mark Evans.
- *                             Adding a route will overwrite any existing route to the same
- *                     network.
+ *                     new multi-protocol edition of hard_header
+ *     Revision 0.23:  IPX /proc by Mark Evans
+ *                     Adding a route will overwrite any existing route to
+ *                     the same network
  *     Revision 0.24:  Supports new /proc with no 4K limit
- *     Revision 0.25:  Add ephemeral sockets, passive local network 
+ *     Revision 0.25:  Add ephemeral sockets, passive local network
  *                     identification, support for local net 0 and
  *                     multiple datalinks <Greg Page>
- *     Revision 0.26:  Device drop kills IPX routes via it. (needed for modules)
+ *     Revision 0.26:  Device drop kills IPX routes via it (needed for modules)
  *     Revision 0.27:  Autobind <Mark Evans>
  *     Revision 0.28:  Small fix for multiple local networks <Thomas Winder>
  *     Revision 0.29:  Assorted major errors removed <Mark Evans>
  *                     Small correction to promisc mode error fix <Alan Cox>
- *                     Asynchronous I/O support.
- *                     Changed to use notifiers and the newer packet_type stuff.
+ *                     Asynchronous I/O support
+ *                     Changed to use notifiers and the newer packet_type stuff
  *                     Assorted major fixes <Alejandro Liu>
  *     Revision 0.30:  Moved to net/ipx/...    <Alan Cox>
- *                     Don't set address length on recvfrom that errors.
- *                     Incorrect verify_area.
- *     Revision 0.31:  New sk_buffs. This still needs a lot of testing. <Alan Cox>
+ *                     Don't set address length on recvfrom that errors
+ *                     Incorrect verify_area
+ *     Revision 0.31:  New sk_buffs. This still needs a lot of testing
+ *                     <Alan Cox>
  *     Revision 0.32:  Using sock_alloc_send_skb, firewall hooks. <Alan Cox>
  *                     Supports sendmsg/recvmsg
  *     Revision 0.33:  Internal network support, routing changes, uses a
- *                     protocol private area for ipx data.
- *     Revision 0.34:  Module support. <Jim Freeman>
- *     Revision 0.35:  Checksum support. <Neil Turton>, hooked in by <Alan Cox>
+ *                     protocol private area for ipx data
+ *     Revision 0.34:  Module support <Jim Freeman>
+ *     Revision 0.35:  Checksum support <Neil Turton>, hooked in by <Alan Cox>
  *                     Handles WIN95 discovery packets <Volker Lendecke>
  *
  *     Protect the module by a MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
  *     Jacques Gelinas (jacques@solucorp.qc.ca)
  *
  *
- *     Portions Copyright (c) 1995 Caldera, Inc. <greg@caldera.com>
- *     Neither Greg Page nor Caldera, Inc. admit liability nor provide 
- *     warranty for any of this software. This material is provided 
- *     "AS-IS" and at no charge.               
+ *     Portions Copyright (c) 1995 Caldera, Inc. <greg@caldera.com>
+ *     Neither Greg Page nor Caldera, Inc. admit liability nor provide
+ *     warranty for any of this software. This material is provided
+ *     "AS-IS" and at no charge.
  */
 
 #include <linux/module.h>
@@ -106,7 +107,7 @@ static struct datalink_proto        *pEII_datalink = NULL;
 static struct datalink_proto   *p8023_datalink = NULL;
 static struct datalink_proto   *pSNAP_datalink = NULL;
 
-static ipx_route       *ipx_routes = NULL;
+static ipx_route       *ipx_routes = NULL;
 static ipx_interface   *ipx_interfaces = NULL;
 static ipx_interface   *ipx_primary_net = NULL;
 static ipx_interface   *ipx_internal_net = NULL;
@@ -124,7 +125,7 @@ ipxcfg_set_auto_create(char val)
        }
        return 0;
 }
-               
+
 static int
 ipxcfg_set_auto_select(char val)
 {
@@ -138,7 +139,7 @@ static int
 ipxcfg_get_config_data(ipx_config_data *arg)
 {
        ipx_config_data vals;
-       
+
        vals.ipxcfg_auto_create_interfaces = ipxcfg_auto_create_interfaces;
        vals.ipxcfg_auto_select_primary = ipxcfg_auto_select_primary;
        memcpy_tofs(arg, &vals, sizeof(vals));
@@ -146,19 +147,19 @@ ipxcfg_get_config_data(ipx_config_data *arg)
 }
 
 
-/***********************************************************************************************************************\
-*                                                                                                                      *
-*                                              Handlers for the socket list.                                           *
-*                                                                                                                      *
-\***********************************************************************************************************************/
+/***************************************************************************\
+*                                                                          *
+*                      Handlers for the socket list.                       *
+*                                                                          *
+\***************************************************************************/
 
 /*
  *     Note: Sockets may not be removed _during_ an interrupt or inet_bh
  *     handler using this technique. They can be added although we do not
  *     use this facility.
  */
-static void 
+
+static void
 ipx_remove_socket(ipx_socket *sk)
 {
        ipx_socket      *s;
@@ -167,7 +168,7 @@ ipx_remove_socket(ipx_socket *sk)
 
        save_flags(flags);
        cli();
-       
+
        /* Determine interface with which socket is associated */
        intrfc = sk->protinfo.af_ipx.intrfc;
        if (intrfc == NULL) {
@@ -180,7 +181,7 @@ ipx_remove_socket(ipx_socket *sk)
                intrfc->if_sklist=s->next;
                restore_flags(flags);
                return;
-       } 
+       }
 
        while(s && s->next) {
                if(s->next==sk) {
@@ -199,8 +200,8 @@ ipx_remove_socket(ipx_socket *sk)
  *     Once it is removed from the queue no interrupt or bottom half will
  *     touch it and we are (fairly 8-) ) safe.
  */
-static void 
+
+static void
 ipx_destroy_socket(ipx_socket *sk)
 {
        struct sk_buff  *skb;
@@ -209,11 +210,11 @@ ipx_destroy_socket(ipx_socket *sk)
        while((skb=skb_dequeue(&sk->receive_queue))!=NULL) {
                kfree_skb(skb,FREE_READ);
        }
-       
+
        sk_free(sk);
        MOD_DEC_USE_COUNT;
 }
-       
+
 /* The following code is used to support IPX Interfaces (IPXITF).  An
  * IPX interface is defined by a physical device and a frame type.
  */
@@ -234,8 +235,8 @@ ipxitf_find_using_phys(struct device *dev, unsigned short datalink)
 {
        ipx_interface   *i;
 
-       for (i=ipx_interfaces; 
-               i && ((i->if_dev!=dev) || (i->if_dlink_type!=datalink)); 
+       for (i=ipx_interfaces;
+               i && ((i->if_dev!=dev) || (i->if_dlink_type!=datalink));
                i=i->if_next)
                ;
        return i;
@@ -277,8 +278,8 @@ ipxitf_find_socket(ipx_interface *intrfc, unsigned short port)
 {
        ipx_socket      *s;
 
-       for (s=intrfc->if_sklist; 
-               (s != NULL) && (s->protinfo.af_ipx.port != port); 
+       for (s=intrfc->if_sklist;
+               (s != NULL) && (s->protinfo.af_ipx.port != port);
                s=s->next)
                ;
 
@@ -303,7 +304,7 @@ ipxitf_find_internal_socket(ipx_interface *intrfc,
                s = s->next;
        }
        return s;
-}      
+}
 #endif
 
 static void ipxrtr_del_routes(ipx_interface *);
@@ -334,11 +335,11 @@ ipxitf_down(ipx_interface *intrfc)
        if (intrfc == ipx_interfaces) {
                ipx_interfaces = intrfc->if_next;
        } else {
-               for (i = ipx_interfaces; 
+               for (i = ipx_interfaces;
                        (i != NULL) && (i->if_next != intrfc);
                        i = i->if_next)
                        ;
-               if ((i != NULL) && (i->if_next == intrfc)) 
+               if ((i != NULL) && (i->if_next == intrfc))
                        i->if_next = intrfc->if_next;
        }
 
@@ -356,7 +357,7 @@ ipxitf_down(ipx_interface *intrfc)
        return;
 }
 
-static int 
+static int
 ipxitf_device_event(struct notifier_block *notifier, unsigned long event, void *ptr)
 {
        struct device *dev = ptr;
@@ -366,9 +367,9 @@ ipxitf_device_event(struct notifier_block *notifier, unsigned long event, void *
                return NOTIFY_DONE;
 
        for (i = ipx_interfaces; i != NULL; ) {
-       
+
                tmp = i->if_next;
-               if (i->if_dev == dev) 
+               if (i->if_dev == dev)
                        ipxitf_down(i);
                i = tmp;
 
@@ -381,12 +382,12 @@ static int ipxitf_def_skb_handler(struct sock *sock, struct sk_buff *skb)
 {
        int     retval;
 
-       if((retval = sock_queue_rcv_skb(sock, skb))<0) 
+       if((retval = sock_queue_rcv_skb(sock, skb))<0)
        {
                /*
                 * skb->sk is NULL here, so FREE_WRITE does not hurt
                 * the sending socket.
-                */
+                */
                kfree_skb(skb,FREE_WRITE);
        }
        return retval;
@@ -398,7 +399,7 @@ static int ipxitf_def_skb_handler(struct sock *sock, struct sk_buff *skb)
 
 #ifdef CONFIG_IPX_INTERN
 static int
-ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy) 
+ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
 {
        ipx_packet      *ipx = (ipx_packet *)(skb->h.raw);
        ipx_socket      *s;
@@ -462,16 +463,16 @@ ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
 #else
 
 static int
-ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy) 
+ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
 {
        ipx_packet      *ipx = (ipx_packet *)(skb->h.raw);
        ipx_socket      *sock1 = NULL, *sock2 = NULL;
        struct sk_buff  *skb1 = NULL, *skb2 = NULL;
 
        if (intrfc == ipx_primary_net
-         && ntohs(ipx->ipx_dest.sock) == 0x451) 
+         && ntohs(ipx->ipx_dest.sock) == 0x451)
        {
-         /* 
+         /*
           * The packet's target is a NCP connection handler. We want to
           * hand it to the correct socket directly within the kernel,
           * so that the mars_nwe packet distribution process
@@ -484,25 +485,25 @@ ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
          int connection = 0;
 
          if (    *((char*)(ipx+1))   == 0x22
-             &&  *((char*)(ipx+1)+1) == 0x22) 
+             &&  *((char*)(ipx+1)+1) == 0x22)
          {
-               /*
+               /*
                 * The packet is a NCP request
                 */
                 connection = ( ((int) *((char*)(ipx+1)+5)) << 8 )
-                              | (int) *((char*)(ipx+1)+3);
-         } 
+                              | (int) *((char*)(ipx+1)+3);
+         }
          else if (    *((char*)(ipx+1))   == 0x77
-                  &&  *((char*)(ipx+1)+1) == 0x77) 
+                  &&  *((char*)(ipx+1)+1) == 0x77)
          {
                /*
                 * The packet is a BURST packet
                 */
                 connection = ( ((int) *((char*)(ipx+1)+9)) << 8 )
-                              | (int) *((char*)(ipx+1)+8);
+                              | (int) *((char*)(ipx+1)+8);
          }
 
-          if (connection) 
+          if (connection)
          {
            /*
             * Now we have to look for a special NCP connection handling
@@ -515,7 +516,7 @@ ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
                sock1=sock1->next);;
           }
         }
-        if (sock1 == NULL) 
+        if (sock1 == NULL)
        {
                /* No special socket found, forward the packet the
                 * normal way.
@@ -530,21 +531,21 @@ ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
         *      The *SPECIAL* socket list contains: 0x452(SAP), 0x453(RIP) and
         *      0x456(Diagnostic).
         */
-        
-       if (ipx_primary_net && (intrfc != ipx_primary_net)) 
+
+       if (ipx_primary_net && (intrfc != ipx_primary_net))
        {
-               switch (ntohs(ipx->ipx_dest.sock)) 
+               switch (ntohs(ipx->ipx_dest.sock))
                {
                        case 0x452:
                        case 0x453:
                        case 0x456:
                                /*
                                 *      The appropriate thing to do here is to
-                                *      dup the packet and route to the primary net
+                                *      dup the packet and route to the primary net
                                 *      interface via ipxitf_send; however, we'll cheat
                                 *      and just demux it here.
                                 */
-                               sock2 = ipxitf_find_socket(ipx_primary_net, 
+                               sock2 = ipxitf_find_socket(ipx_primary_net,
                                        ipx->ipx_dest.sock);
                                break;
                        default:
@@ -552,57 +553,57 @@ ipxitf_demux_socket(ipx_interface *intrfc, struct sk_buff *skb, int copy)
                }
        }
 
-       /* 
+       /*
         *      if there is nothing to do, return. The kfree will
         *      cancel any charging.
         */
-        
-       if (sock1 == NULL && sock2 == NULL) 
+
+       if (sock1 == NULL && sock2 == NULL)
        {
-               if (!copy) 
+               if (!copy)
                        kfree_skb(skb,FREE_WRITE);
                return 0;
        }
 
        /*
         * This next segment of code is a little awkward, but it sets it up
-        * so that the appropriate number of copies of the SKB are made and 
-        * that skb1 and skb2 point to it (them) so that it (they) can be 
+        * so that the appropriate number of copies of the SKB are made and
+        * that skb1 and skb2 point to it (them) so that it (they) can be
         * demuxed to sock1 and/or sock2.  If we are unable to make enough
         * copies, we do as much as is possible.
         */
-        
-       if (copy) 
+
+       if (copy)
        {
                skb1 = skb_clone(skb, GFP_ATOMIC);
-               if (skb1 != NULL) 
+               if (skb1 != NULL)
                        skb1->arp = skb1->free = 1;
-       } 
-       else 
+       }
+       else
        {
                skb1 = skb;
        }
-       
-       if (skb1 == NULL) 
-               return -ENOMEM; 
+
+       if (skb1 == NULL)
+               return -ENOMEM;
 
        /*
-        *      Do we need 2 SKBs? 
+        *      Do we need 2 SKBs?
         */
-        
-       if (sock1 && sock2) 
+
+       if (sock1 && sock2)
        {
                skb2 = skb_clone(skb1, GFP_ATOMIC);
-               if (skb2 != NULL) 
+               if (skb2 != NULL)
                        skb2->arp = skb2->free = 1;
        }
-       else 
+       else
                skb2 = skb1;
-               
+
        if (sock1)
                (void) ipxitf_def_skb_handler(sock1, skb1);
 
-       if (skb2 == NULL) 
+       if (skb2 == NULL)
                return -ENOMEM;
 
        if (sock2)
@@ -648,28 +649,28 @@ static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
        char            dest_node[IPX_NODE_LEN];
        int             send_to_wire = 1;
        int             addr_len;
-       
-       /* 
+
+       /*
         *      We need to know how many skbuffs it will take to send out this
         *      packet to avoid unnecessary copies.
         */
-        
-       if ((dl == NULL) || (dev == NULL) || (dev->flags & IFF_LOOPBACK)) 
+
+       if ((dl == NULL) || (dev == NULL) || (dev->flags & IFF_LOOPBACK))
                send_to_wire = 0;       /* No non looped */
 
        /*
-        *      See if this should be demuxed to sockets on this interface 
+        *      See if this should be demuxed to sockets on this interface
         *
         *      We want to ensure the original was eaten or that we only use
         *      up clones.
         */
-        
-       if (ipx->ipx_dest.net == intrfc->if_netnum) 
+
+       if (ipx->ipx_dest.net == intrfc->if_netnum)
        {
                /*
                 *      To our own node, loop and free the original.
                 */
-               if (memcmp(intrfc->if_node, node, IPX_NODE_LEN) == 0) 
+               if (memcmp(intrfc->if_node, node, IPX_NODE_LEN) == 0)
                {
                        /*
                         *      Don't charge sender
@@ -687,7 +688,7 @@ static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
                /*
                 *      Broadcast, loop and possibly keep to send on.
                 */
-               if (memcmp(ipx_broadcast_node, node, IPX_NODE_LEN) == 0) 
+               if (memcmp(ipx_broadcast_node, node, IPX_NODE_LEN) == 0)
                {
                        if (!send_to_wire && skb->sk)
                        {
@@ -695,30 +696,30 @@ static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
                                skb->sk=NULL;
                        }
                        ipxitf_demux_socket(intrfc, skb, send_to_wire);
-                       if (!send_to_wire) 
+                       if (!send_to_wire)
                                return 0;
                }
        }
 
        /*
-        *      If the originating net is not equal to our net; this is routed 
+        *      If the originating net is not equal to our net; this is routed
         *      We are still charging the sender. Which is right - the driver
         *      free will handle this fairly.
         */
-        
-       if (ipx->ipx_source.net != intrfc->if_netnum) 
+
+       if (ipx->ipx_source.net != intrfc->if_netnum)
        {
-               if (++(ipx->ipx_tctrl) > ipxcfg_max_hops) 
+               if (++(ipx->ipx_tctrl) > ipxcfg_max_hops)
                        send_to_wire = 0;
        }
 
-       if (!send_to_wire) 
+       if (!send_to_wire)
        {
                /*
                 *      We do a FREE_WRITE here because this indicates how
-                *      to treat the socket with which the packet is 
-                *      associated.  If this packet is associated with a
-                *      socket at all, it must be the originator of the 
+                *      to treat the socket with which the packet is
+                *      associated.  If this packet is associated with a
+                *      socket at all, it must be the originator of the
                 *      packet.   Routed packets will have no socket associated
                 *      with them.
                 */
@@ -727,21 +728,21 @@ static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
        }
 
        /*
-        *      Determine the appropriate hardware address 
+        *      Determine the appropriate hardware address
         */
-        
+
        addr_len = dev->addr_len;
-       if (memcmp(ipx_broadcast_node, node, IPX_NODE_LEN) == 0) 
+       if (memcmp(ipx_broadcast_node, node, IPX_NODE_LEN) == 0)
                memcpy(dest_node, dev->broadcast, addr_len);
        else
                memcpy(dest_node, &(node[IPX_NODE_LEN-addr_len]), addr_len);
 
        /*
-        *      Make any compensation for differing physical/data link size 
+        *      Make any compensation for differing physical/data link size
         */
-        
+
        skb = ipxitf_adjust_skbuff(intrfc, skb);
-       if (skb == NULL) 
+       if (skb == NULL)
                return 0;
 
        /* set up data link and physical headers */
@@ -749,18 +750,18 @@ static int ipxitf_send(ipx_interface *intrfc, struct sk_buff *skb, char *node)
        skb->protocol = htons(ETH_P_IPX);
        dl->datalink_header(dl, skb, dest_node);
 #if 0
-       /* 
-        *      Now log the packet just before transmission 
+       /*
+        *      Now log the packet just before transmission
         */
-        
+
        dump_pkt("IPX snd:", (ipx_packet *)skb->h.raw);
        dump_data("ETH hdr:", skb->data, skb->h.raw - skb->data);
 #endif
 
        /*
-        *      Send it out 
+        *      Send it out
         */
-        
+
        dev_queue_xmit(skb, dev, SOPRI_NORMAL);
        return 0;
 }
@@ -775,58 +776,74 @@ static int ipxitf_add_local_route(ipx_interface *intrfc)
 static const char * ipx_frame_name(unsigned short);
 static const char * ipx_device_name(ipx_interface *);
 static int ipxrtr_route_skb(struct sk_buff *);
+static int ipxrtr_route_skb_type20(ipx_interface *intrfc, struct sk_buff *);
 
 static int ipxitf_rcv(ipx_interface *intrfc, struct sk_buff *skb)
 {
        ipx_packet      *ipx = (ipx_packet *) (skb->h.raw);
        ipx_interface   *i;
 
-#ifdef CONFIG_FIREWALL 
+#ifdef CONFIG_FIREWALL
        /*
         *      We firewall first, ask questions later.
         */
-        
+
        if (call_in_firewall(PF_IPX, skb->dev, ipx, NULL)!=FW_ACCEPT)
        {
                kfree_skb(skb, FREE_READ);
                return 0;
        }
-       
-#endif 
+
+#endif
 
        /* See if we should update our network number */
-       if ((intrfc->if_netnum == 0L) && 
+       if ((intrfc->if_netnum == 0L) &&
                (ipx->ipx_source.net == ipx->ipx_dest.net) &&
-               (ipx->ipx_source.net != 0L)) 
+               (ipx->ipx_source.net != 0L))
        {
                /* NB: NetWare servers lie about their hop count so we
                 * dropped the test based on it.  This is the best way
                 * to determine this is a 0 hop count packet.
                 */
-               if ((i=ipxitf_find_using_net(ipx->ipx_source.net))==NULL) 
+               if ((i=ipxitf_find_using_net(ipx->ipx_source.net))==NULL)
                {
                        intrfc->if_netnum = ipx->ipx_source.net;
                        (void) ipxitf_add_local_route(intrfc);
-               } 
-               else 
+               }
+               else
                {
                        printk(KERN_WARNING "IPX: Network number collision %lx\n        %s %s and %s %s\n",
-                               htonl(ipx->ipx_source.net), 
+                               htonl(ipx->ipx_source.net),
                                ipx_device_name(i),
                                ipx_frame_name(i->if_dlink_type),
                                ipx_device_name(intrfc),
                                ipx_frame_name(intrfc->if_dlink_type));
                }
        }
+       /*
+        * "This shouldn't happen, but just in case"
+        */
+       if (ipx->ipx_tctrl > ipxcfg_max_hops)
+       {
+               kfree_skb(skb, FREE_READ);
+               return 0;
+       }
+
+       /*
+        * Do the IPX Packet Type 20 routing
+        */
+       if (ipx->ipx_type == IPX_TYPE_PPROP)
+               return ipxrtr_route_skb_type20(intrfc, skb);
+
 
        if (ipx->ipx_dest.net == 0L)
                ipx->ipx_dest.net = intrfc->if_netnum;
        if (ipx->ipx_source.net == 0L)
                ipx->ipx_source.net = intrfc->if_netnum;
 
-       if (intrfc->if_netnum != ipx->ipx_dest.net) 
+       if (intrfc->if_netnum != ipx->ipx_dest.net)
        {
-#ifdef CONFIG_FIREWALL 
+#ifdef CONFIG_FIREWALL
                /*
                 *      See if we are allowed to firewall forward
                 */
@@ -835,18 +852,18 @@ static int ipxitf_rcv(ipx_interface *intrfc, struct sk_buff *skb)
                        kfree_skb(skb, FREE_READ);
                        return 0;
                }
-#endif         
+#endif
                /* We only route point-to-point packets. */
                if (skb->pkt_type == PACKET_HOST)
                        return ipxrtr_route_skb(skb);
-               
+
                kfree_skb(skb,FREE_READ);
                return 0;
        }
 
        /* see if we should keep it */
-       if ((memcmp(ipx_broadcast_node, ipx->ipx_dest.node, IPX_NODE_LEN) == 0) 
-               || (memcmp(intrfc->if_node, ipx->ipx_dest.node, IPX_NODE_LEN) == 0)) 
+       if ((memcmp(ipx_broadcast_node, ipx->ipx_dest.node, IPX_NODE_LEN) == 0)
+               || (memcmp(intrfc->if_node, ipx->ipx_dest.node, IPX_NODE_LEN) == 0))
        {
                return ipxitf_demux_socket(intrfc, skb, 0);
        }
@@ -876,7 +893,7 @@ ipxitf_insert(ipx_interface *intrfc)
        return;
 }
 
-static int 
+static int
 ipxitf_create_internal(ipx_interface_definition *idef)
 {
        ipx_interface   *intrfc;
@@ -920,7 +937,7 @@ ipx_map_frame_type(unsigned char type)
        return 0;
 }
 
-static int 
+static int
 ipxitf_create(ipx_interface_definition *idef)
 {
        struct device   *dev;
@@ -928,7 +945,7 @@ ipxitf_create(ipx_interface_definition *idef)
        struct datalink_proto   *datalink = NULL;
        ipx_interface   *intrfc;
 
-       if (idef->ipx_special == IPX_INTERNAL) 
+       if (idef->ipx_special == IPX_INTERNAL)
                return ipxitf_create_internal(idef);
 
        if ((idef->ipx_special == IPX_PRIMARY) && (ipx_primary_net != NULL))
@@ -939,7 +956,7 @@ ipxitf_create(ipx_interface_definition *idef)
                return -EADDRINUSE;
 
        switch (idef->ipx_dlink_type) {
-       case IPX_FRAME_ETHERII: 
+       case IPX_FRAME_ETHERII:
                dlink_type = htons(ETH_P_IPX);
                datalink = pEII_datalink;
                break;
@@ -964,11 +981,11 @@ ipxitf_create(ipx_interface_definition *idef)
                break;
        }
 
-       if (datalink == NULL) 
+       if (datalink == NULL)
                return -EPROTONOSUPPORT;
 
        dev=dev_get(idef->ipx_device);
-       if (dev==NULL) 
+       if (dev==NULL)
                return -ENODEV;
 
        if (!(dev->flags & IFF_UP))
@@ -978,7 +995,7 @@ ipxitf_create(ipx_interface_definition *idef)
        if(dev->addr_len>IPX_NODE_LEN)
                return -EINVAL;
 
-       if ((intrfc = ipxitf_find_using_phys(dev, dlink_type)) == NULL) 
+       if ((intrfc = ipxitf_find_using_phys(dev, dlink_type)) == NULL)
        {
                /* Ok now create */
                intrfc=(ipx_interface *)kmalloc(sizeof(ipx_interface),GFP_ATOMIC);
@@ -991,14 +1008,14 @@ ipxitf_create(ipx_interface_definition *idef)
                intrfc->if_sklist = NULL;
                intrfc->if_sknum = IPX_MIN_EPHEMERAL_SOCKET;
                /* Setup primary if necessary */
-               if ((idef->ipx_special == IPX_PRIMARY)) 
+               if ((idef->ipx_special == IPX_PRIMARY))
                        ipx_primary_net = intrfc;
                intrfc->if_internal = 0;
                intrfc->if_ipx_offset = dev->hard_header_len + datalink->header_length;
                if(memcmp(idef->ipx_node, "\000\000\000\000\000\000", IPX_NODE_LEN)==0)
                {
                        memset(intrfc->if_node, 0, IPX_NODE_LEN);
-                       memcpy((char *)&(intrfc->if_node[IPX_NODE_LEN-dev->addr_len]), 
+                       memcpy((char *)&(intrfc->if_node[IPX_NODE_LEN-dev->addr_len]),
                                dev->dev_addr, dev->addr_len);
                }
                else
@@ -1007,13 +1024,13 @@ ipxitf_create(ipx_interface_definition *idef)
        }
 
        /* If the network number is known, add a route */
-       if (intrfc->if_netnum == 0L) 
+       if (intrfc->if_netnum == 0L)
                return 0;
 
        return ipxitf_add_local_route(intrfc);
 }
 
-static int 
+static int
 ipxitf_delete(ipx_interface_definition *idef)
 {
        struct device   *dev = NULL;
@@ -1057,7 +1074,7 @@ ipxitf_auto_create(struct device *dev, unsigned short dlink_type)
        case ETH_P_802_3: datalink = p8023_datalink; break;
        default: return NULL;
        }
-       
+
        if (dev == NULL)
                return NULL;
 
@@ -1073,10 +1090,10 @@ ipxitf_auto_create(struct device *dev, unsigned short dlink_type)
                intrfc->if_sklist = NULL;
                intrfc->if_internal = 0;
                intrfc->if_sknum = IPX_MIN_EPHEMERAL_SOCKET;
-               intrfc->if_ipx_offset = dev->hard_header_len + 
+               intrfc->if_ipx_offset = dev->hard_header_len +
                        datalink->header_length;
                memset(intrfc->if_node, 0, IPX_NODE_LEN);
-               memcpy((char *)&(intrfc->if_node[IPX_NODE_LEN-dev->addr_len]), 
+               memcpy((char *)&(intrfc->if_node[IPX_NODE_LEN-dev->addr_len]),
                        dev->dev_addr, dev->addr_len);
                ipxitf_insert(intrfc);
        }
@@ -1084,7 +1101,7 @@ ipxitf_auto_create(struct device *dev, unsigned short dlink_type)
        return intrfc;
 }
 
-static int 
+static int
 ipxitf_ioctl_real(unsigned int cmd, void *arg)
 {
        int err;
@@ -1150,7 +1167,7 @@ ipxitf_ioctl_real(unsigned int cmd, void *arg)
        }
 }
 
-static int 
+static int
 ipxitf_ioctl(unsigned int cmd, void *arg)
 {
        int ret;
@@ -1159,11 +1176,11 @@ ipxitf_ioctl(unsigned int cmd, void *arg)
        MOD_DEC_USE_COUNT;
        return ret;
 }
-/*******************************************************************************************************************\
-*                                                                                                                  *
-*                                      Routing tables for the IPX socket layer                                     *
-*                                                                                                                  *
-\*******************************************************************************************************************/
+/***************************************************************************\
+*                                                                          *
+*              Routing tables for the IPX socket layer                     *
+*                                                                          *
+\***************************************************************************/
 
 static ipx_route *
 ipxrtr_lookup(unsigned long net)
@@ -1220,7 +1237,7 @@ ipxrtr_del_routes(ipx_interface *intrfc)
        }
 }
 
-static int 
+static int
 ipxrtr_create(ipx_route_definition *rd)
 {
        ipx_interface *intrfc;
@@ -1234,7 +1251,7 @@ ipxrtr_create(ipx_route_definition *rd)
 }
 
 
-static int 
+static int
 ipxrtr_delete(long net)
 {
        ipx_route       **r;
@@ -1249,7 +1266,7 @@ ipxrtr_delete(long net)
                        *r = tmp->ir_next;
                        kfree_s(tmp, sizeof(ipx_route));
                        return 0;
-               } 
+               }
                r = &(tmp->ir_next);
        }
 
@@ -1259,13 +1276,13 @@ ipxrtr_delete(long net)
 /*
  *     Checksum routine for IPX
  */
+
 /* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
 
-static __u16 ipx_set_checksum(ipx_packet *packet,int length) 
+static __u16 ipx_set_checksum(ipx_packet *packet,int length)
 {
-       /* 
-        *      NOTE: sum is a net byte order quantity, which optimizes the 
+       /*
+        *      NOTE: sum is a net byte order quantity, which optimizes the
         *      loop. This only works on big and little endian machines. (I
         *      don't know of a machine that isn't.)
         */
@@ -1279,7 +1296,7 @@ static __u16 ipx_set_checksum(ipx_packet *packet,int length)
        __u16 *p=(__u16 *)&packet->ipx_pktsize;
 
        /*
-        *      Number of complete words 
+        *      Number of complete words
         */
 
        __u32 i=length>>1;
@@ -1288,14 +1305,14 @@ static __u16 ipx_set_checksum(ipx_packet *packet,int length)
        packet->ipx_tctrl = 0;     /* hop count excluded from checksum calc */
 
        /*
-        *      Loop through all complete words except the checksum field 
+        *      Loop through all complete words except the checksum field
         */
 
        while(--i)
                sum+=*p++;
 
        /*
-        *      Add on the last part word if it exists 
+        *      Add on the last part word if it exists
         */
 
        if(packet->ipx_pktsize&htons(1))
@@ -1303,22 +1320,22 @@ static __u16 ipx_set_checksum(ipx_packet *packet,int length)
 
        packet->ipx_tctrl = hops;
        /*
-        *      Do final fixup 
+        *      Do final fixup
         */
-        
+
        sum=(sum&0xffff)+(sum>>16);
 
        /*
-        *      It's a pity there's no concept of carry in C 
+        *      It's a pity there's no concept of carry in C
         */
 
        if(sum>=0x10000)
                sum++;
-               
+
        return ~sum;
 };
 
+
 /*
  *     Route an outgoing frame from a socket.
  */
@@ -1332,14 +1349,14 @@ static int ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, struc
        int ipx_offset;
        ipx_route *rt = NULL;
        int err;
-       
+
        /* Find the appropriate interface on which to send packet */
-       if ((usipx->sipx_network == 0L) && (ipx_primary_net != NULL)) 
+       if ((usipx->sipx_network == 0L) && (ipx_primary_net != NULL))
        {
                usipx->sipx_network = ipx_primary_net->if_netnum;
                intrfc = ipx_primary_net;
-       } 
-       else 
+       }
+       else
        {
                rt = ipxrtr_lookup(usipx->sipx_network);
                if (rt==NULL) {
@@ -1347,7 +1364,7 @@ static int ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, struc
                }
                intrfc = rt->ir_intrfc;
        }
-       
+
        ipx_offset = intrfc->if_ipx_offset;
        size=sizeof(ipx_packet)+len;
        size += ipx_offset;
@@ -1372,7 +1389,7 @@ static int ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, struc
 #ifdef CONFIG_IPX_INTERN
        memcpy(ipx->ipx_source.node, sk->protinfo.af_ipx.node, IPX_NODE_LEN);
 #else
-       if ((err = ntohs(sk->protinfo.af_ipx.port)) == 0x453 || err == 0x452)  
+       if ((err = ntohs(sk->protinfo.af_ipx.port)) == 0x453 || err == 0x452)
        {
                /* RIP/SAP special handling for mars_nwe */
                ipx->ipx_source.net = intrfc->if_netnum;
@@ -1394,24 +1411,24 @@ static int ipxrtr_route_packet(ipx_socket *sk, struct sockaddr_ipx *usipx, struc
        /*
         *      Apply checksum. Not allowed on 802.3 links.
         */
-        
+
        if(sk->no_check || intrfc->if_dlink_type==IPX_FRAME_8023)
                ipx->ipx_checksum=0xFFFF;
        else
                ipx->ipx_checksum=ipx_set_checksum(ipx, len+sizeof(ipx_packet));
 
-#ifdef CONFIG_FIREWALL 
+#ifdef CONFIG_FIREWALL
        if(call_out_firewall(PF_IPX, skb->dev, ipx, NULL)!=FW_ACCEPT)
        {
                kfree_skb(skb, FREE_WRITE);
                return -EPERM;
        }
 #endif
-       
-       return ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ? 
+
+       return ipxitf_send(intrfc, skb, (rt && rt->ir_routed) ?
                                rt->ir_router_node : ipx->ipx_dest.node);
 }
-       
+
 static int
 ipxrtr_route_skb(struct sk_buff *skb)
 {
@@ -1426,11 +1443,56 @@ ipxrtr_route_skb(struct sk_buff *skb)
                return 0;
        }
        i = r->ir_intrfc;
-       (void)ipxitf_send(i, skb, (r->ir_routed) ? 
+       (void)ipxitf_send(i, skb, (r->ir_routed) ?
                        r->ir_router_node : ipx->ipx_dest.node);
        return 0;
 }
 
+static int
+ipxrtr_route_skb_type20(ipx_interface *intrfc, struct sk_buff *skb)
+{
+       ipx_packet *ipx = (ipx_packet *) (skb->h.raw);
+       unsigned long *net_num = (long *) (ipx + 1);
+       ipx_interface *ipx_if;
+       struct sk_buff *skb2;
+       int i;
+
+       if (ipx->ipx_tctrl > 8)
+       {
+               kfree_skb(skb, FREE_READ);
+               return 0;
+       }
+
+       for(i = 0; i < ipx->ipx_tctrl; ++i)
+       if(intrfc->if_netnum == net_num[i])
+       {
+               kfree_skb(skb, FREE_READ);
+               return 0;
+       }
+
+       net_num[i] = intrfc->if_netnum;
+       ++ipx->ipx_tctrl;
+
+       for(ipx_if = ipx_interfaces; ipx_if != NULL; ipx_if = ipx_if->if_next)
+       {
+               for(i = 0; i < ipx->ipx_tctrl; ++i)
+               if(ipx_if->if_netnum == net_num[i])
+                       break;
+
+               if(i != ipx->ipx_tctrl)
+                       continue;
+
+               ipx->ipx_dest.net = ipx_if->if_netnum;
+
+               skb2 = skb_clone(skb, GFP_ATOMIC);
+               ipxrtr_route_skb(skb2);
+       }
+
+       kfree_skb(skb, FREE_READ);
+
+       return 0;
+}
+
 /*
  *     We use a normal struct rtentry for route handling
  */
@@ -1444,19 +1506,19 @@ static int ipxrtr_ioctl(unsigned int cmd, void *arg)
        err=verify_area(VERIFY_READ,arg,sizeof(rt));
        if(err)
                return err;
-               
+
        memcpy_fromfs(&rt,arg,sizeof(rt));
-       
+
        sg=(struct sockaddr_ipx *)&rt.rt_gateway;
        st=(struct sockaddr_ipx *)&rt.rt_dst;
-       
+
        if(!(rt.rt_flags&RTF_GATEWAY))
                return -EINVAL;         /* Direct routes are fixed */
        if(sg->sipx_family!=AF_IPX)
                return -EINVAL;
        if(st->sipx_family!=AF_IPX)
                return -EINVAL;
-               
+
        switch(cmd)
        {
                case SIOCDELRT:
@@ -1505,22 +1567,22 @@ static int ipx_interface_get_info(char *buffer, char **start, off_t offset,
 
        /* Theory.. Keep printing in the same place until we pass offset */
 
-       len += sprintf (buffer,"%-11s%-15s%-9s%-11s%s\n", "Network", 
+       len += sprintf (buffer,"%-11s%-15s%-9s%-11s%s\n", "Network",
                "Node_Address", "Primary", "Device", "Frame_Type");
        for (i = ipx_interfaces; i != NULL; i = i->if_next) {
                len += sprintf(buffer+len, "%08lX   ", ntohl(i->if_netnum));
-               len += sprintf (buffer+len,"%02X%02X%02X%02X%02X%02X   ", 
+               len += sprintf (buffer+len,"%02X%02X%02X%02X%02X%02X   ",
                                i->if_node[0], i->if_node[1], i->if_node[2],
                                i->if_node[3], i->if_node[4], i->if_node[5]);
                len += sprintf(buffer+len, "%-9s", (i == ipx_primary_net) ?
                        "Yes" : "No");
                len += sprintf (buffer+len, "%-11s", ipx_device_name(i));
-               len += sprintf (buffer+len, "%s\n", 
+               len += sprintf (buffer+len, "%s\n",
                        ipx_frame_name(i->if_dlink_type));
 
                /* Are we still dumping unwanted data then discard the record */
                pos=begin+len;
-               
+
                if(pos<offset) {
                        len=0;                  /* Keep dumping into the buffer start */
                        begin=pos;
@@ -1528,13 +1590,13 @@ static int ipx_interface_get_info(char *buffer, char **start, off_t offset,
                if(pos>offset+length)           /* We have dumped enough */
                        break;
        }
-       
+
        /* The data in question runs from begin to begin+len */
        *start=buffer+(offset-begin);   /* Start of wanted data */
        len-=(offset-begin);            /* Remove unwanted header data from length */
        if(len>length)
                len=length;             /* Remove unwanted tail data from length */
-       
+
        return len;
 }
 
@@ -1549,28 +1611,28 @@ static int ipx_get_info(char *buffer, char **start, off_t offset,
 
        /* Theory.. Keep printing in the same place until we pass offset */
 
-#ifdef CONFIG_IPX_INTERN       
-       len += sprintf (buffer,"%-28s%-28s%-10s%-10s%-7s%s\n", "Local_Address", 
+#ifdef CONFIG_IPX_INTERN
+       len += sprintf (buffer,"%-28s%-28s%-10s%-10s%-7s%s\n", "Local_Address",
 #else
-       len += sprintf (buffer,"%-15s%-28s%-10s%-10s%-7s%s\n", "Local_Address", 
+       len += sprintf (buffer,"%-15s%-28s%-10s%-10s%-7s%s\n", "Local_Address",
 #endif
-                       "Remote_Address", "Tx_Queue", "Rx_Queue", 
+                       "Remote_Address", "Tx_Queue", "Rx_Queue",
                        "State", "Uid");
        for (i = ipx_interfaces; i != NULL; i = i->if_next) {
                for (s = i->if_sklist; s != NULL; s = s->next) {
 #ifdef CONFIG_IPX_INTERN
                        len += sprintf(buffer+len,
-                                      "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ", 
+                                      "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
                                 htonl(s->protinfo.af_ipx.intrfc->if_netnum),
                                       s->protinfo.af_ipx.node[0],
-                                      s->protinfo.af_ipx.node[1], 
-                                      s->protinfo.af_ipx.node[2], 
-                                      s->protinfo.af_ipx.node[3], 
-                                      s->protinfo.af_ipx.node[4], 
+                                      s->protinfo.af_ipx.node[1],
+                                      s->protinfo.af_ipx.node[2],
+                                      s->protinfo.af_ipx.node[3],
+                                      s->protinfo.af_ipx.node[4],
                                       s->protinfo.af_ipx.node[5],
                                       htons(s->protinfo.af_ipx.port));
 #else
-                       len += sprintf(buffer+len,"%08lX:%04X  ", 
+                       len += sprintf(buffer+len,"%08lX:%04X  ",
                                       htonl(i->if_netnum),
                                       htons(s->protinfo.af_ipx.port));
 #endif
@@ -1578,40 +1640,40 @@ static int ipx_get_info(char *buffer, char **start, off_t offset,
                                len += sprintf(buffer+len, "%-28s", "Not_Connected");
                        } else {
                                len += sprintf (buffer+len,
-                                       "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ", 
+                                       "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
                                        htonl(s->protinfo.af_ipx.dest_addr.net),
                                        s->protinfo.af_ipx.dest_addr.node[0],
-                                       s->protinfo.af_ipx.dest_addr.node[1], 
+                                       s->protinfo.af_ipx.dest_addr.node[1],
                                        s->protinfo.af_ipx.dest_addr.node[2],
-                                       s->protinfo.af_ipx.dest_addr.node[3], 
+                                       s->protinfo.af_ipx.dest_addr.node[3],
                                        s->protinfo.af_ipx.dest_addr.node[4],
                                        s->protinfo.af_ipx.dest_addr.node[5],
                                        htons(s->protinfo.af_ipx.dest_addr.sock));
                        }
-                       len += sprintf (buffer+len,"%08X  %08X  ", 
+                       len += sprintf (buffer+len,"%08X  %08X  ",
                                s->wmem_alloc, s->rmem_alloc);
-                       len += sprintf (buffer+len,"%02X     %03d\n", 
+                       len += sprintf (buffer+len,"%02X     %03d\n",
                                s->state, SOCK_INODE(s->socket)->i_uid);
-               
+
                        /* Are we still dumping unwanted data then discard the record */
                        pos=begin+len;
-               
+
                        if(pos<offset)
                        {
-                               len=0;                  /* Keep dumping into the buffer start */
+                               len=0;  /* Keep dumping into the buffer start */
                                begin=pos;
                        }
-                       if(pos>offset+length)           /* We have dumped enough */
+                       if(pos>offset+length)   /* We have dumped enough */
                                break;
                }
        }
-       
+
        /* The data in question runs from begin to begin+len */
        *start=buffer+(offset-begin);   /* Start of wanted data */
        len-=(offset-begin);            /* Remove unwanted header data from length */
        if(len>length)
                len=length;             /* Remove unwanted tail data from length */
-       
+
        return len;
 }
 
@@ -1623,16 +1685,16 @@ static int ipx_rt_get_info(char *buffer, char **start, off_t offset,
        off_t pos=0;
        off_t begin=0;
 
-       len += sprintf (buffer,"%-11s%-13s%s\n", 
+       len += sprintf (buffer,"%-11s%-13s%s\n",
                        "Network", "Router_Net", "Router_Node");
        for (rt = ipx_routes; rt != NULL; rt = rt->ir_next)
        {
                len += sprintf (buffer+len,"%08lX   ", ntohl(rt->ir_net));
                if (rt->ir_routed) {
-                       len += sprintf (buffer+len,"%08lX     %02X%02X%02X%02X%02X%02X\n", 
-                               ntohl(rt->ir_intrfc->if_netnum), 
-                               rt->ir_router_node[0], rt->ir_router_node[1], 
-                               rt->ir_router_node[2], rt->ir_router_node[3], 
+                       len += sprintf (buffer+len,"%08lX     %02X%02X%02X%02X%02X%02X\n",
+                               ntohl(rt->ir_intrfc->if_netnum),
+                               rt->ir_router_node[0], rt->ir_router_node[1],
+                               rt->ir_router_node[2], rt->ir_router_node[3],
                                rt->ir_router_node[4], rt->ir_router_node[5]);
                } else {
                        len += sprintf (buffer+len, "%-13s%s\n",
@@ -1654,11 +1716,12 @@ static int ipx_rt_get_info(char *buffer, char **start, off_t offset,
        return len;
 }
 
-/*******************************************************************************************************************\
-*                                                                                                                  *
-*            Handling for system calls applied via the various interfaces to an IPX socket object                  *
-*                                                                                                                  *
-\*******************************************************************************************************************/
+/***************************************************************************\
+*                                                                          *
+*      Handling for system calls applied via the various interfaces        *
+*      to an IPX socket object                                             *
+*                                                                          *
+\***************************************************************************/
 
 static int ipx_fcntl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
@@ -1673,9 +1736,9 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname, char *opt
 {
        ipx_socket *sk;
        int err,opt;
-       
+
        sk=(ipx_socket *)sock->data;
-       
+
        if(optval==NULL)
                return(-EINVAL);
 
@@ -1683,7 +1746,7 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname, char *opt
        if(err)
                return err;
        opt=get_fs_long((unsigned long *)optval);
-       
+
        switch(level)
        {
                case SOL_IPX:
@@ -1696,7 +1759,7 @@ static int ipx_setsockopt(struct socket *sock, int level, int optname, char *opt
                                        return -EOPNOTSUPP;
                        }
                        break;
-                       
+
                case SOL_SOCKET:
                        return sock_setsockopt(sk,level,optname,optval,optlen);
 
@@ -1711,7 +1774,7 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
        ipx_socket *sk;
        int val=0;
        int err;
-       
+
        sk=(ipx_socket *)sock->data;
 
        switch(level)
@@ -1727,10 +1790,10 @@ static int ipx_getsockopt(struct socket *sock, int level, int optname,
                                        return -ENOPROTOOPT;
                        }
                        break;
-                       
+
                case SOL_SOCKET:
                        return sock_getsockopt(sk,level,optname,optval,optlen);
-                       
+
                default:
                        return -EOPNOTSUPP;
        }
@@ -1790,13 +1853,13 @@ static int ipx_create(struct socket *sock, int protocol)
        sk->socket=sock;
        sk->type=sock->type;
        sk->mtu=IPX_MTU;
-       sk->no_check = 1;               /* Checksum off by default */   
+       sk->no_check = 1;               /* Checksum off by default */
        if(sock!=NULL)
        {
                sock->data=(void *)sk;
                sk->sleep=sock->wait;
        }
-       
+
        sk->state_change=def_callback1;
        sk->data_ready=def_callback2;
        sk->write_space=def_callback1;
@@ -1825,7 +1888,7 @@ static int ipx_dup(struct socket *newsock,struct socket *oldsock)
        return(ipx_create(newsock,SOCK_DGRAM));
 }
 
-static unsigned short 
+static unsigned short
 ipx_first_free_socketnum(ipx_interface *intrfc)
 {
        unsigned short  socketNum = intrfc->if_sknum;
@@ -1842,21 +1905,21 @@ ipx_first_free_socketnum(ipx_interface *intrfc)
        intrfc->if_sknum = socketNum;
        return  ntohs(socketNum);
 }
-       
+
 static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,int addr_len)
 {
        ipx_socket *sk;
        ipx_interface *intrfc;
        struct sockaddr_ipx *addr=(struct sockaddr_ipx *)uaddr;
-       
+
        sk=(ipx_socket *)sock->data;
-       
+
        if(sk->zapped==0)
                return -EIO;
-               
+
        if(addr_len!=sizeof(struct sockaddr_ipx))
                return -EINVAL;
-       
+
        intrfc = ipxitf_find_using_net(addr->sipx_network);
        if (intrfc == NULL)
                return -EADDRNOTAVAIL;
@@ -1894,8 +1957,8 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,int addr_len)
                {
                        memcpy(sk->protinfo.af_ipx.node, addr->sipx_node, IPX_NODE_LEN);
                }
-               if (ipxitf_find_internal_socket(intrfc, 
-                       sk->protinfo.af_ipx.node, 
+               if (ipxitf_find_internal_socket(intrfc,
+                       sk->protinfo.af_ipx.node,
                        sk->protinfo.af_ipx.port) != NULL)
                {
                        if(sk->debug)
@@ -1911,14 +1974,14 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,int addr_len)
                 * with the ipx routing ioctl()
                 */
 
-               memcpy(sk->protinfo.af_ipx.node, intrfc->if_node, 
+               memcpy(sk->protinfo.af_ipx.node, intrfc->if_node,
                        IPX_NODE_LEN);
-               
+
                if(ipxitf_find_socket(intrfc, addr->sipx_port)!=NULL) {
                        if(sk->debug)
                                printk("IPX: bind failed because port %X in"
                                       " use.\n", (int)addr->sipx_port);
-                       return -EADDRINUSE;        
+                       return -EADDRINUSE;
                }
        }
 
@@ -1931,7 +1994,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr,int addr_len)
                if(sk->debug)
                        printk("IPX: bind failed because port %X in use.\n",
                                (int)addr->sipx_port);
-               return -EADDRINUSE;        
+               return -EADDRINUSE;
        }
 
 #endif
@@ -1948,20 +2011,20 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
 {
        ipx_socket *sk=(ipx_socket *)sock->data;
        struct sockaddr_ipx *addr;
-       
-       sk->state = TCP_CLOSE;  
+
+       sk->state = TCP_CLOSE;
        sock->state = SS_UNCONNECTED;
 
        if(addr_len!=sizeof(*addr))
                return(-EINVAL);
        addr=(struct sockaddr_ipx *)uaddr;
-       
+
        if(sk->protinfo.af_ipx.port==0)
        /* put the autobinding in */
        {
                struct sockaddr_ipx uaddr;
                int ret;
-       
+
                uaddr.sipx_port = 0;
                uaddr.sipx_network = 0L;
 #ifdef CONFIG_IPX_INTERN
@@ -1972,7 +2035,7 @@ static int ipx_connect(struct socket *sock, struct sockaddr *uaddr,
                                sizeof(struct sockaddr_ipx));
                if (ret != 0) return (ret);
        }
-       
+
        if(ipxrtr_lookup(addr->sipx_network)==NULL)
                return -ENETUNREACH;
        sk->protinfo.af_ipx.dest_addr.net=addr->sipx_network;
@@ -2005,11 +2068,11 @@ static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
        ipx_address *addr;
        struct sockaddr_ipx sipx;
        ipx_socket *sk;
-       
+
        sk=(ipx_socket *)sock->data;
-       
+
        *uaddr_len = sizeof(struct sockaddr_ipx);
-               
+
        if(peer) {
                if(sk->state!=TCP_ESTABLISHED)
                        return -ENOTCONN;
@@ -2023,7 +2086,7 @@ static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
 #ifdef CONFIG_IPX_INTERN
                        memcpy(sipx.sipx_node, sk->protinfo.af_ipx.node, IPX_NODE_LEN);
 #else
-                       memcpy(sipx.sipx_node, 
+                       memcpy(sipx.sipx_node,
                                sk->protinfo.af_ipx.intrfc->if_node, IPX_NODE_LEN);
 #endif
 
@@ -2033,7 +2096,7 @@ static int ipx_getname(struct socket *sock, struct sockaddr *uaddr,
                }
                sipx.sipx_port = sk->protinfo.af_ipx.port;
        }
-               
+
        sipx.sipx_family = AF_IPX;
        sipx.sipx_type = sk->protinfo.af_ipx.type;
        memcpy(uaddr,&sipx,sizeof(sipx));
@@ -2102,18 +2165,18 @@ int ipx_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
        /* NULL here for pt means the packet was looped back */
        ipx_interface   *intrfc;
        ipx_packet *ipx;
-       
-       
+
+
        ipx=(ipx_packet *)skb->h.raw;
-       
+
        /* Too small */
-       
+
        if(ntohs(ipx->ipx_pktsize)<sizeof(ipx_packet)) {
                kfree_skb(skb,FREE_READ);
                return 0;
        }
-       
-       if(ipx->ipx_checksum!=IPX_NO_CHECKSUM) 
+
+       if(ipx->ipx_checksum!=IPX_NO_CHECKSUM)
        {
                if(ipx_set_checksum(ipx, ntohs(ipx->ipx_pktsize))!=ipx->ipx_checksum)
                {
@@ -2121,13 +2184,13 @@ int ipx_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
                        return 0;
                }
        }
-       
+
        /* Determine what local ipx endpoint this is */
        intrfc = ipxitf_find_using_phys(dev, pt->type);
-       if (intrfc == NULL) 
+       if (intrfc == NULL)
        {
                if (ipxcfg_auto_create_interfaces &&
-                   ntohl(ipx->ipx_dest.net)!=0L) 
+                   ntohl(ipx->ipx_dest.net)!=0L)
                {
                        intrfc = ipxitf_auto_create(dev, pt->type);
                }
@@ -2150,20 +2213,20 @@ static int ipx_sendmsg(struct socket *sock, struct msghdr *msg, int len, int nob
        struct sockaddr_ipx local_sipx;
        int retval;
 
-       if (sk->zapped) 
+       if (sk->zapped)
                return -EIO; /* Socket not bound */
-       if(flags) 
+       if(flags)
                return -EINVAL;
-               
-       if(usipx) 
+
+       if(usipx)
        {
-               if(sk->protinfo.af_ipx.port == 0) 
+               if(sk->protinfo.af_ipx.port == 0)
                {
                        struct sockaddr_ipx uaddr;
                        int ret;
 
                        uaddr.sipx_port = 0;
-                       uaddr.sipx_network = 0L; 
+                       uaddr.sipx_network = 0L;
 #ifdef CONFIG_IPX_INTERN
                        memcpy(uaddr.sipx_node, sk->protinfo.af_ipx.intrfc
                                ->if_node, IPX_NODE_LEN);
@@ -2178,7 +2241,7 @@ static int ipx_sendmsg(struct socket *sock, struct msghdr *msg, int len, int nob
                if(usipx->sipx_family != AF_IPX)
                        return -EINVAL;
        }
-       else 
+       else
        {
                if(sk->state!=TCP_ESTABLISHED)
                        return -ENOTCONN;
@@ -2189,9 +2252,9 @@ static int ipx_sendmsg(struct socket *sock, struct msghdr *msg, int len, int nob
                usipx->sipx_network=sk->protinfo.af_ipx.dest_addr.net;
                memcpy(usipx->sipx_node,sk->protinfo.af_ipx.dest_addr.node,IPX_NODE_LEN);
        }
-       
+
        retval = ipxrtr_route_packet(sk, usipx, msg->msg_iov, len, noblock);
-       if (retval < 0) 
+       if (retval < 0)
                return retval;
 
        return len;
@@ -2208,10 +2271,10 @@ static int ipx_recvmsg(struct socket *sock, struct msghdr *msg, int size, int no
        int truesize;
        struct sk_buff *skb;
        int er;
-       
+
        if(sk->err)
                return sock_error(sk);
-       
+
        if (sk->zapped)
                return -EIO;
 
@@ -2219,7 +2282,7 @@ static int ipx_recvmsg(struct socket *sock, struct msghdr *msg, int size, int no
        skb=skb_recv_datagram(sk,flags,noblock,&er);
        if(skb==NULL)
                return er;
-       
+
        if(addr_len)
                *addr_len=sizeof(*sipx);
 
@@ -2227,7 +2290,7 @@ static int ipx_recvmsg(struct socket *sock, struct msghdr *msg, int size, int no
        truesize=ntohs(ipx->ipx_pktsize) - sizeof(ipx_packet);
        copied = (truesize > size) ? size : truesize;
        skb_copy_datagram_iovec(skb,sizeof(struct ipx_packet),msg->msg_iov,copied);
-       
+
        if(sipx)
        {
                sipx->sipx_family=AF_IPX;
@@ -2238,7 +2301,7 @@ static int ipx_recvmsg(struct socket *sock, struct msghdr *msg, int size, int no
        }
        skb_free_datagram(sk, skb);
        return(truesize);
-}              
+}
 
 static int ipx_shutdown(struct socket *sk,int how)
 {
@@ -2248,7 +2311,7 @@ static int ipx_shutdown(struct socket *sk,int how)
 static int ipx_select(struct socket *sock , int sel_type, select_table *wait)
 {
        ipx_socket *sk=(ipx_socket *)sock->data;
-       
+
        return datagram_select(sk,sel_type,wait);
 }
 
@@ -2257,7 +2320,7 @@ static int ipx_ioctl(struct socket *sock,unsigned int cmd, unsigned long arg)
        int err;
        long amount=0;
        ipx_socket *sk=(ipx_socket *)sock->data;
-       
+
        switch(cmd)
        {
                case TIOCOUTQ:
@@ -2293,7 +2356,7 @@ static int ipx_ioctl(struct socket *sock,unsigned int cmd, unsigned long arg)
                                return -EPERM;
                case SIOCGIFADDR:
                        return(ipxitf_ioctl(cmd,(void *)arg));
-               case SIOCIPXCFGDATA: 
+               case SIOCIPXCFGDATA:
                {
                        err=verify_area(VERIFY_WRITE,(void *)arg,
                                sizeof(ipx_config_data));
@@ -2343,7 +2406,6 @@ static int ipx_ioctl(struct socket *sock,unsigned int cmd, unsigned long arg)
 
 static struct proto_ops ipx_proto_ops = {
        AF_IPX,
-       
        ipx_create,
        ipx_dup,
        ipx_release,
@@ -2365,7 +2427,7 @@ static struct proto_ops ipx_proto_ops = {
 
 /* Called by protocol.c on kernel start up */
 
-static struct packet_type ipx_8023_packet_type = 
+static struct packet_type ipx_8023_packet_type =
 
 {
        0,      /* MUTTER ntohs(ETH_P_8023),*/
@@ -2375,7 +2437,7 @@ static struct packet_type ipx_8023_packet_type =
        NULL,
 };
 
-static struct packet_type ipx_dix_packet_type = 
+static struct packet_type ipx_dix_packet_type =
 {
        0,      /* MUTTER ntohs(ETH_P_IPX),*/
        NULL,           /* All devices */
@@ -2426,23 +2488,23 @@ ipx_proto_init(struct net_proto *pro)
        p8023_datalink = make_8023_client();
        ipx_8023_packet_type.type=htons(ETH_P_802_3);
        dev_add_pack(&ipx_8023_packet_type);
-       
+
        if ((p8022_datalink = register_8022_client(ipx_8022_type, ipx_rcv)) == NULL)
                printk(KERN_CRIT "IPX: Unable to register with 802.2\n");
 
        if ((p8022tr_datalink = register_8022tr_client(ipx_8022_type, ipx_rcv)) == NULL)
                printk(KERN_CRIT "IPX: Unable to register with 802.2TR\n");
+
        if ((pSNAP_datalink = register_snap_client(ipx_snap_id, ipx_rcv)) == NULL)
                printk(KERN_CRIT "IPX: Unable to register with SNAP\n");
-       
+
        register_netdevice_notifier(&ipx_dev_notifier);
 #ifdef CONFIG_PROC_FS
        proc_net_register(&ipx_procinfo);
        proc_net_register(&ipx_if_procinfo);
        proc_net_register(&ipx_rt_procinfo);
-#endif 
-               
+#endif
+
        printk(KERN_INFO "Swansea University Computer Society IPX 0.34 for NET3.035\n");
        printk(KERN_INFO "IPX Portions Copyright (c) 1995 Caldera, Inc.\n");
 }
@@ -2452,13 +2514,13 @@ ipx_proto_init(struct net_proto *pro)
  *
  * Use counts are incremented/decremented when
  * sockets are created/deleted.
- * 
+ *
  * Routes are always associated with an interface, and
  * allocs/frees will remain properly accounted for by
  * their associated interfaces.
- * 
+ *
  * Ergo, before the ipx module can be removed, all IPX
- * sockets be closed from user space. 
+ * sockets be closed from user space.
  */
 
 static void
@@ -2476,7 +2538,7 @@ ipx_proto_finito(void)
        proc_net_unregister(PROC_NET_IPX_ROUTE);
        proc_net_unregister(PROC_NET_IPX_INTERFACE);
        proc_net_unregister(PROC_NET_IPX);
-#endif 
+#endif
 
        unregister_netdevice_notifier(&ipx_dev_notifier);