Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 6 Nov 2006 03:10:04 +0000 (19:10 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 6 Nov 2006 03:10:04 +0000 (19:10 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETLABEL]: Fix build failure.
  [IPV6]: Give sit driver an appropriate module alias.
  [IPV6]: Add ndisc_netdev_notifier unregister.
  [NET]: __alloc_pages() failures reported due to fragmentation
  [PKTGEN]: TCI endianness fixes
  [TG3]: Fix 2nd ifup failure on 5752M.
  [NETFILTER] bug: skb->protocol is already net-endian
  [NETFILTER] bug: nfulnl_msg_config_mode ->copy_range is 32bit
  [NETFILTER] bug: NFULA_CFG_QTHRESH uses 32bit
  [IPV6]: Fix ECN bug on big-endian
  [IPX]: Annotate and fix IPX checksum
  [IPX]: Trivial parts of endianness annotations

15 files changed:
drivers/net/tg3.c
include/linux/ipx.h
include/net/inet_ecn.h
include/net/ipx.h
net/Kconfig
net/core/pktgen.c
net/core/sock.c
net/ipv6/ndisc.c
net/ipv6/sit.c
net/ipx/af_ipx.c
net/ipx/ipx_proc.c
net/ipx/ipx_route.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netlabel/Kconfig

index 8e39849..8f059b7 100644 (file)
@@ -68,8 +68,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.67"
-#define DRV_MODULE_RELDATE     "October 18, 2006"
+#define DRV_MODULE_VERSION     "3.68"
+#define DRV_MODULE_RELDATE     "November 02, 2006"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -6014,7 +6014,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
                tg3_abort_hw(tp, 1);
        }
 
-       if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) && reset_phy)
+       if (reset_phy)
                tg3_phy_reset(tp);
 
        err = tg3_chip_reset(tp);
@@ -6574,7 +6574,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
                tw32(GRC_LOCAL_CTRL, tp->grc_local_ctrl);
        }
 
-       err = tg3_setup_phy(tp, reset_phy);
+       err = tg3_setup_phy(tp, 0);
        if (err)
                return err;
 
index 4f29c60..eb19b4e 100644 (file)
@@ -7,8 +7,8 @@
 
 struct sockaddr_ipx {
        sa_family_t     sipx_family;
-       __u16           sipx_port;
-       __u32           sipx_network;
+       __be16          sipx_port;
+       __be32          sipx_network;
        unsigned char   sipx_node[IPX_NODE_LEN];
        __u8            sipx_type;
        unsigned char   sipx_zero;      /* 16 byte fill */
@@ -23,13 +23,13 @@ struct sockaddr_ipx {
 #define IPX_CRTITF     1
 
 struct ipx_route_definition {
-       __u32         ipx_network;
-       __u32         ipx_router_network;
+       __be32        ipx_network;
+       __be32        ipx_router_network;
        unsigned char ipx_router_node[IPX_NODE_LEN];
 };
 
 struct ipx_interface_definition {
-       __u32         ipx_network;
+       __be32        ipx_network;
        unsigned char ipx_device[16];
        unsigned char ipx_dlink_type;
 #define IPX_FRAME_NONE         0
@@ -55,8 +55,8 @@ struct ipx_config_data {
  */
 
 struct ipx_route_def {
-       __u32           ipx_network;
-       __u32           ipx_router_network;
+       __be32          ipx_network;
+       __be32          ipx_router_network;
 #define IPX_ROUTE_NO_ROUTER    0
        unsigned char   ipx_router_node[IPX_NODE_LEN];
        unsigned char   ipx_device[16];
index d599c6b..7849844 100644 (file)
@@ -48,7 +48,7 @@ static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
 
 #define        IP6_ECN_flow_xmit(sk, label) do {                               \
        if (INET_ECN_is_capable(inet_sk(sk)->tos))                      \
-               (label) |= __constant_htons(INET_ECN_ECT_0 << 4);       \
+               (label) |= htonl(INET_ECN_ECT_0 << 20);                 \
     } while (0)
 
 static inline int IP_ECN_set_ce(struct iphdr *iph)
index 5c0cf33..c6b2ee6 100644 (file)
@@ -15,9 +15,9 @@
 #include <linux/list.h>
 
 struct ipx_address {
-       __u32   net;
+       __be32  net;
        __u8    node[IPX_NODE_LEN]; 
-       __u16   sock;
+       __be16  sock;
 };
 
 #define ipx_broadcast_node     "\377\377\377\377\377\377"
@@ -26,9 +26,9 @@ struct ipx_address {
 #define IPX_MAX_PPROP_HOPS 8
 
 struct ipxhdr {
-       __u16                   ipx_checksum __attribute__ ((packed));
-#define IPX_NO_CHECKSUM        0xFFFF
-       __u16                   ipx_pktsize __attribute__ ((packed));
+       __be16                  ipx_checksum __attribute__ ((packed));
+#define IPX_NO_CHECKSUM        __constant_htons(0xFFFF)
+       __be16                  ipx_pktsize __attribute__ ((packed));
        __u8                    ipx_tctrl;
        __u8                    ipx_type;
 #define IPX_TYPE_UNKNOWN       0x00
@@ -48,14 +48,14 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
 
 struct ipx_interface {
        /* IPX address */
-       __u32                   if_netnum;
+       __be32                  if_netnum;
        unsigned char           if_node[IPX_NODE_LEN];
        atomic_t                refcnt;
 
        /* physical device info */
        struct net_device       *if_dev;
        struct datalink_proto   *if_dlink;
-       unsigned short          if_dlink_type;
+       __be16                  if_dlink_type;
 
        /* socket support */
        unsigned short          if_sknum;
@@ -71,7 +71,7 @@ struct ipx_interface {
 };
 
 struct ipx_route {
-       __u32                   ir_net;
+       __be32                  ir_net;
        struct ipx_interface    *ir_intrfc;
        unsigned char           ir_routed;
        unsigned char           ir_router_node[IPX_NODE_LEN];
@@ -82,10 +82,10 @@ struct ipx_route {
 #ifdef __KERNEL__
 struct ipx_cb {
        u8      ipx_tctrl;
-       u32     ipx_dest_net;
-       u32     ipx_source_net;
+       __be32  ipx_dest_net;
+       __be32  ipx_source_net;
        struct {
-               u32 netnum;
+               __be32 netnum;
                int index;
        } last_hop;
 };
@@ -97,7 +97,7 @@ struct ipx_sock {
        struct sock             sk;
        struct ipx_address      dest_addr;
        struct ipx_interface    *intrfc;
-       unsigned short          port;
+       __be16                  port;
 #ifdef CONFIG_IPX_INTERN
        unsigned char           node[IPX_NODE_LEN];
 #endif
@@ -132,7 +132,7 @@ extern struct ipx_interface *ipx_primary_net;
 extern int ipx_proc_init(void);
 extern void ipx_proc_exit(void);
 
-extern const char *ipx_frame_name(unsigned short);
+extern const char *ipx_frame_name(__be16);
 extern const char *ipx_device_name(struct ipx_interface *intrfc);
 
 static __inline__ void ipxitf_hold(struct ipx_interface *intrfc)
index a81aca4..67e39ad 100644 (file)
@@ -63,6 +63,7 @@ config INET
 if INET
 source "net/ipv4/Kconfig"
 source "net/ipv6/Kconfig"
+source "net/netlabel/Kconfig"
 
 endif # if INET
 
@@ -249,8 +250,6 @@ source "net/ieee80211/Kconfig"
 config WIRELESS_EXT
        bool
 
-source "net/netlabel/Kconfig"
-
 config FIB_RULES
        bool
 
index dd023fd..733d86d 100644 (file)
@@ -2304,6 +2304,12 @@ static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev)
        *mpls |= MPLS_STACK_BOTTOM;
 }
 
+static inline __be16 build_tci(unsigned int id, unsigned int cfi,
+                              unsigned int prio)
+{
+       return htons(id | (cfi << 12) | (prio << 13));
+}
+
 static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
                                        struct pktgen_dev *pkt_dev)
 {
@@ -2353,16 +2359,16 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
        if (pkt_dev->vlan_id != 0xffff) {
                if(pkt_dev->svlan_id != 0xffff) {
                        svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-                       *svlan_tci = htons(pkt_dev->svlan_id);
-                       *svlan_tci |= pkt_dev->svlan_p << 5;
-                       *svlan_tci |= pkt_dev->svlan_cfi << 4;
+                       *svlan_tci = build_tci(pkt_dev->svlan_id,
+                                              pkt_dev->svlan_cfi,
+                                              pkt_dev->svlan_p);
                        svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                        *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q);
                }
                vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-               *vlan_tci = htons(pkt_dev->vlan_id);
-               *vlan_tci |= pkt_dev->vlan_p << 5;
-               *vlan_tci |= pkt_dev->vlan_cfi << 4;
+               *vlan_tci = build_tci(pkt_dev->vlan_id,
+                                     pkt_dev->vlan_cfi,
+                                     pkt_dev->vlan_p);
                vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                *vlan_encapsulated_proto = __constant_htons(ETH_P_IP);
        }
@@ -2689,16 +2695,16 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
        if (pkt_dev->vlan_id != 0xffff) {
                if(pkt_dev->svlan_id != 0xffff) {
                        svlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-                       *svlan_tci = htons(pkt_dev->svlan_id);
-                       *svlan_tci |= pkt_dev->svlan_p << 5;
-                       *svlan_tci |= pkt_dev->svlan_cfi << 4;
+                       *svlan_tci = build_tci(pkt_dev->svlan_id,
+                                              pkt_dev->svlan_cfi,
+                                              pkt_dev->svlan_p);
                        svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                        *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q);
                }
                vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
-               *vlan_tci = htons(pkt_dev->vlan_id);
-               *vlan_tci |= pkt_dev->vlan_p << 5;
-               *vlan_tci |= pkt_dev->vlan_cfi << 4;
+               *vlan_tci = build_tci(pkt_dev->vlan_id,
+                                     pkt_dev->vlan_cfi,
+                                     pkt_dev->vlan_p);
                vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
                *vlan_encapsulated_proto = __constant_htons(ETH_P_IPV6);
        }
index d472db4..ee6cd25 100644 (file)
@@ -1160,7 +1160,7 @@ static struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
                        goto failure;
 
                if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) {
-                       skb = alloc_skb(header_len, sk->sk_allocation);
+                       skb = alloc_skb(header_len, gfp_mask);
                        if (skb) {
                                int npages;
                                int i;
index 41a8a5f..73eb8c3 100644 (file)
@@ -1742,6 +1742,7 @@ int __init ndisc_init(struct net_proto_family *ops)
 
 void ndisc_cleanup(void)
 {
+       unregister_netdevice_notifier(&ndisc_netdev_notifier);
 #ifdef CONFIG_SYSCTL
        neigh_sysctl_unregister(&nd_tbl.parms);
 #endif
index b481a4d..be699f8 100644 (file)
@@ -854,3 +854,4 @@ int __init sit_init(void)
 module_init(sit_init);
 module_exit(sit_cleanup);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("sit0");
index bef3f61..76c6615 100644 (file)
@@ -83,13 +83,13 @@ DEFINE_SPINLOCK(ipx_interfaces_lock);
 struct ipx_interface *ipx_primary_net;
 struct ipx_interface *ipx_internal_net;
 
-extern int ipxrtr_add_route(__u32 network, struct ipx_interface *intrfc,
+extern int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
                            unsigned char *node);
 extern void ipxrtr_del_routes(struct ipx_interface *intrfc);
 extern int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
                               struct iovec *iov, int len, int noblock);
 extern int ipxrtr_route_skb(struct sk_buff *skb);
-extern struct ipx_route *ipxrtr_lookup(__u32 net);
+extern struct ipx_route *ipxrtr_lookup(__be32 net);
 extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg);
 
 #undef IPX_REFCNT_DEBUG
@@ -177,7 +177,7 @@ static void ipxitf_clear_primary_net(void)
 }
 
 static struct ipx_interface *__ipxitf_find_using_phys(struct net_device *dev,
-                                                     unsigned short datalink)
+                                                     __be16 datalink)
 {
        struct ipx_interface *i;
 
@@ -190,7 +190,7 @@ out:
 }
 
 static struct ipx_interface *ipxitf_find_using_phys(struct net_device *dev,
-                                                   unsigned short datalink)
+                                                   __be16 datalink)
 {
        struct ipx_interface *i;
 
@@ -202,7 +202,7 @@ static struct ipx_interface *ipxitf_find_using_phys(struct net_device *dev,
        return i;
 }
 
-struct ipx_interface *ipxitf_find_using_net(__u32 net)
+struct ipx_interface *ipxitf_find_using_net(__be32 net)
 {
        struct ipx_interface *i;
 
@@ -237,7 +237,7 @@ static void ipxitf_insert_socket(struct ipx_interface *intrfc, struct sock *sk)
 
 /* caller must hold intrfc->if_sklist_lock */
 static struct sock *__ipxitf_find_socket(struct ipx_interface *intrfc,
-                                        unsigned short port)
+                                        __be16 port)
 {
        struct sock *s;
        struct hlist_node *node;
@@ -252,7 +252,7 @@ found:
 
 /* caller must hold a reference to intrfc */
 static struct sock *ipxitf_find_socket(struct ipx_interface *intrfc,
-                                       unsigned short port)
+                                       __be16 port)
 {
        struct sock *s;
 
@@ -268,7 +268,7 @@ static struct sock *ipxitf_find_socket(struct ipx_interface *intrfc,
 #ifdef CONFIG_IPX_INTERN
 static struct sock *ipxitf_find_internal_socket(struct ipx_interface *intrfc,
                                                unsigned char *ipx_node,
-                                               unsigned short port)
+                                               __be16 port)
 {
        struct sock *s;
        struct hlist_node *node;
@@ -600,10 +600,10 @@ int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb, char *node)
 
        /* see if we need to include the netnum in the route list */
        if (IPX_SKB_CB(skb)->last_hop.index >= 0) {
-               u32 *last_hop = (u32 *)(((u8 *) skb->data) +
+               __be32 *last_hop = (__be32 *)(((u8 *) skb->data) +
                                sizeof(struct ipxhdr) +
                                IPX_SKB_CB(skb)->last_hop.index *
-                               sizeof(u32));
+                               sizeof(__be32));
                *last_hop = IPX_SKB_CB(skb)->last_hop.netnum;
                IPX_SKB_CB(skb)->last_hop.index = -1;
        }
@@ -772,7 +772,7 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
                } else {
                        printk(KERN_WARNING "IPX: Network number collision "
                                "%lx\n        %s %s and %s %s\n",
-                               (unsigned long) htonl(cb->ipx_source_net),
+                               (unsigned long) ntohl(cb->ipx_source_net),
                                ipx_device_name(i),
                                ipx_frame_name(i->if_dlink_type),
                                ipx_device_name(intrfc),
@@ -812,7 +812,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
        int i, rc = -EINVAL;
        struct ipx_interface *ifcs;
        char *c;
-       u32 *l;
+       __be32 *l;
 
        /* Illegal packet - too many hops or too short */
        /* We decide to throw it away: no broadcasting, no local processing.
@@ -833,7 +833,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
                goto out;
        
        c = ((u8 *) ipx) + sizeof(struct ipxhdr);
-       l = (u32 *) c;
+       l = (__be32 *) c;
 
        /* Don't broadcast packet if already seen this net */
        for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
@@ -855,7 +855,7 @@ static int ipxitf_pprop(struct ipx_interface *intrfc, struct sk_buff *skb)
                /* That aren't in the list */
                if (ifcs == intrfc)
                        continue;
-               l = (__u32 *) c;
+               l = (__be32 *) c;
                /* don't consider the last entry in the packet list,
                 * it is our netnum, and it is not there yet */
                for (i = 0; i < IPX_SKB_CB(skb)->ipx_tctrl; i++)
@@ -885,8 +885,8 @@ static void ipxitf_insert(struct ipx_interface *intrfc)
                ipx_primary_net = intrfc;
 }
 
-static struct ipx_interface *ipxitf_alloc(struct net_device *dev, __u32 netnum,
-                                         unsigned short dlink_type,
+static struct ipx_interface *ipxitf_alloc(struct net_device *dev, __be32 netnum,
+                                         __be16 dlink_type,
                                          struct datalink_proto *dlink,
                                          unsigned char internal,
                                          int ipx_offset)
@@ -960,7 +960,7 @@ static __be16 ipx_map_frame_type(unsigned char type)
 static int ipxitf_create(struct ipx_interface_definition *idef)
 {
        struct net_device *dev;
-       unsigned short dlink_type = 0;
+       __be16 dlink_type = 0;
        struct datalink_proto *datalink = NULL;
        struct ipx_interface *intrfc;
        int rc;
@@ -1073,7 +1073,7 @@ out:
 static int ipxitf_delete(struct ipx_interface_definition *idef)
 {
        struct net_device *dev = NULL;
-       unsigned short dlink_type = 0;
+       __be16 dlink_type = 0;
        struct ipx_interface *intrfc;
        int rc = 0;
 
@@ -1110,7 +1110,7 @@ out:
 }
 
 static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
-                                               unsigned short dlink_type)
+                                               __be16 dlink_type)
 {
        struct ipx_interface *intrfc = NULL;
        struct datalink_proto *datalink;
@@ -1122,7 +1122,7 @@ static struct ipx_interface *ipxitf_auto_create(struct net_device *dev,
        if (dev->addr_len > IPX_NODE_LEN)
                goto out;
 
-       switch (htons(dlink_type)) {
+       switch (ntohs(dlink_type)) {
        case ETH_P_IPX:         datalink = pEII_datalink;       break;
        case ETH_P_802_2:       datalink = p8022_datalink;      break;
        case ETH_P_SNAP:        datalink = pSNAP_datalink;      break;
@@ -1234,27 +1234,27 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
 /* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
 /* This functions should *not* mess with packet contents */
 
-__u16 ipx_cksum(struct ipxhdr *packet, int length) 
+__be16 ipx_cksum(struct ipxhdr *packet, int length)
 {
        /* 
         *      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.)
         */
-       /* start at ipx_dest - We skip the checksum field and start with
-        * ipx_type before the loop, not considering ipx_tctrl in the calc */
-       __u16 *p = (__u16 *)&packet->ipx_dest;
-       __u32 i = (length >> 1) - 1; /* Number of complete words */
-       __u32 sum = packet->ipx_type << sizeof(packet->ipx_tctrl); 
-
-       /* Loop through all complete words except the checksum field,
-        * ipx_type (accounted above) and ipx_tctrl (not used in the cksum) */
-       while (--i)
+       /* handle the first 3 words separately; checksum should be skipped
+        * and ipx_tctrl masked out */
+       __u16 *p = (__u16 *)packet;
+       __u32 sum = p[1] + (p[2] & (__force u16)htons(0x00ff));
+       __u32 i = (length >> 1) - 3; /* Number of remaining complete words */
+
+       /* Loop through them */
+       p += 3;
+       while (i--)
                sum += *p++;
 
        /* Add on the last part word if it exists */
        if (packet->ipx_pktsize & htons(1))
-               sum += ntohs(0xff00) & *p;
+               sum += (__force u16)htons(0xff00) & *p;
 
        /* Do final fixup */
        sum = (sum & 0xffff) + (sum >> 16);
@@ -1263,10 +1263,17 @@ __u16 ipx_cksum(struct ipxhdr *packet, int length)
        if (sum >= 0x10000)
                sum++;
 
-       return ~sum;
+       /*
+        * Leave 0 alone; we don't want 0xffff here.  Note that we can't get
+        * here with 0x10000, so this check is the same as ((__u16)sum)
+        */
+       if (sum)
+               sum = ~sum;
+
+       return (__force __be16)sum;
 }
 
-const char *ipx_frame_name(unsigned short frame)
+const char *ipx_frame_name(__be16 frame)
 {
        char* rc = "None";
 
@@ -1401,7 +1408,7 @@ out:
 
 /* caller must hold a reference to intrfc */
 
-static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
+static __be16 ipx_first_free_socketnum(struct ipx_interface *intrfc)
 {
        unsigned short socketNum = intrfc->if_sknum;
 
@@ -1410,7 +1417,7 @@ static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
        if (socketNum < IPX_MIN_EPHEMERAL_SOCKET)
                socketNum = IPX_MIN_EPHEMERAL_SOCKET;
 
-       while (__ipxitf_find_socket(intrfc, ntohs(socketNum)))
+       while (__ipxitf_find_socket(intrfc, htons(socketNum)))
                if (socketNum > IPX_MAX_EPHEMERAL_SOCKET)
                        socketNum = IPX_MIN_EPHEMERAL_SOCKET;
                else
@@ -1419,7 +1426,7 @@ static unsigned short ipx_first_free_socketnum(struct ipx_interface *intrfc)
        spin_unlock_bh(&intrfc->if_sklist_lock);
        intrfc->if_sknum = socketNum;
 
-       return ntohs(socketNum);
+       return htons(socketNum);
 }
 
 static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
@@ -1473,7 +1480,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                                                ipxs->port)) {
                        SOCK_DEBUG(sk,
                                "IPX: bind failed because port %X in use.\n",
-                               ntohs((int)addr->sipx_port));
+                               ntohs(addr->sipx_port));
                        goto out_put;
                }
        } else {
@@ -1488,7 +1495,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                if (ipxitf_find_socket(intrfc, addr->sipx_port)) {
                        SOCK_DEBUG(sk,
                                "IPX: bind failed because port %X in use.\n",
-                               ntohs((int)addr->sipx_port));
+                               ntohs(addr->sipx_port));
                        goto out_put;
                }
        }
@@ -1665,7 +1672,7 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        intrfc = ipxitf_find_using_phys(dev, pt->type);
        if (!intrfc) {
                if (ipxcfg_auto_create_interfaces &&
-                  ntohl(IPX_SKB_CB(skb)->ipx_dest_net)) {
+                  IPX_SKB_CB(skb)->ipx_dest_net) {
                        intrfc = ipxitf_auto_create(dev, pt->type);
                        if (intrfc)
                                ipxitf_hold(intrfc);
index 4c0c712..b7463df 100644 (file)
@@ -260,22 +260,22 @@ static int ipx_seq_socket_show(struct seq_file *seq, void *v)
        ipxs = ipx_sk(s);
 #ifdef CONFIG_IPX_INTERN
        seq_printf(seq, "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
-                  (unsigned long)htonl(ipxs->intrfc->if_netnum),
+                  (unsigned long)ntohl(ipxs->intrfc->if_netnum),
                   ipxs->node[0], ipxs->node[1], ipxs->node[2], ipxs->node[3],
-                  ipxs->node[4], ipxs->node[5], htons(ipxs->port));
+                  ipxs->node[4], ipxs->node[5], ntohs(ipxs->port));
 #else
-       seq_printf(seq, "%08lX:%04X  ", (unsigned long) htonl(ipxs->intrfc->if_netnum),
-                  htons(ipxs->port));
+       seq_printf(seq, "%08lX:%04X  ", (unsigned long) ntohl(ipxs->intrfc->if_netnum),
+                  ntohs(ipxs->port));
 #endif /* CONFIG_IPX_INTERN */
        if (s->sk_state != TCP_ESTABLISHED)
                seq_printf(seq, "%-28s", "Not_Connected");
        else {
                seq_printf(seq, "%08lX:%02X%02X%02X%02X%02X%02X:%04X  ",
-                          (unsigned long)htonl(ipxs->dest_addr.net),
+                          (unsigned long)ntohl(ipxs->dest_addr.net),
                           ipxs->dest_addr.node[0], ipxs->dest_addr.node[1],
                           ipxs->dest_addr.node[2], ipxs->dest_addr.node[3],
                           ipxs->dest_addr.node[4], ipxs->dest_addr.node[5],
-                          htons(ipxs->dest_addr.sock));
+                          ntohs(ipxs->dest_addr.sock));
        }
 
        seq_printf(seq, "%08X  %08X  %02X     %03d\n",
index a30dbb1..68560ee 100644 (file)
@@ -19,17 +19,17 @@ DEFINE_RWLOCK(ipx_routes_lock);
 
 extern struct ipx_interface *ipx_internal_net;
 
-extern __u16 ipx_cksum(struct ipxhdr *packet, int length);
-extern struct ipx_interface *ipxitf_find_using_net(__u32 net);
+extern __be16 ipx_cksum(struct ipxhdr *packet, int length);
+extern struct ipx_interface *ipxitf_find_using_net(__be32 net);
 extern int ipxitf_demux_socket(struct ipx_interface *intrfc,
                               struct sk_buff *skb, int copy);
 extern int ipxitf_demux_socket(struct ipx_interface *intrfc,
                               struct sk_buff *skb, int copy);
 extern int ipxitf_send(struct ipx_interface *intrfc, struct sk_buff *skb,
                       char *node);
-extern struct ipx_interface *ipxitf_find_using_net(__u32 net);
+extern struct ipx_interface *ipxitf_find_using_net(__be32 net);
 
-struct ipx_route *ipxrtr_lookup(__u32 net)
+struct ipx_route *ipxrtr_lookup(__be32 net)
 {
        struct ipx_route *r;
 
@@ -48,7 +48,7 @@ unlock:
 /*
  * Caller must hold a reference to intrfc
  */
-int ipxrtr_add_route(__u32 network, struct ipx_interface *intrfc,
+int ipxrtr_add_route(__be32 network, struct ipx_interface *intrfc,
                     unsigned char *node)
 {
        struct ipx_route *rt;
@@ -118,7 +118,7 @@ out:
        return rc;
 }
 
-static int ipxrtr_delete(__u32 net)
+static int ipxrtr_delete(__be32 net)
 {
        struct ipx_route *r, *tmp;
        int rc;
@@ -238,7 +238,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
 
        /* Apply checksum. Not allowed on 802.3 links. */
        if (sk->sk_no_check || intrfc->if_dlink_type == htons(IPX_FRAME_8023))
-               ipx->ipx_checksum = 0xFFFF;
+               ipx->ipx_checksum = htons(0xFFFF);
        else
                ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr));
 
index b59d3b2..b2bf8f2 100644 (file)
@@ -427,7 +427,7 @@ __build_packet_message(struct nfulnl_instance *inst,
        nfmsg->version = NFNETLINK_V0;
        nfmsg->res_id = htons(inst->group_num);
 
-       pmsg.hw_protocol        = htons(skb->protocol);
+       pmsg.hw_protocol        = skb->protocol;
        pmsg.hook               = hooknum;
 
        NFA_PUT(inst->skb, NFULA_PACKET_HDR, sizeof(pmsg), &pmsg);
@@ -878,7 +878,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
                params = NFA_DATA(nfula[NFULA_CFG_MODE-1]);
 
                nfulnl_set_mode(inst, params->copy_mode,
-                               ntohs(params->copy_range));
+                               ntohl(params->copy_range));
        }
 
        if (nfula[NFULA_CFG_TIMEOUT-1]) {
@@ -896,8 +896,8 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
        }
 
        if (nfula[NFULA_CFG_QTHRESH-1]) {
-               u_int32_t qthresh = 
-                       *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_QTHRESH-1]);
+               __be32 qthresh =
+                       *(__be32 *)NFA_DATA(nfula[NFULA_CFG_QTHRESH-1]);
 
                nfulnl_set_qthresh(inst, ntohl(qthresh));
        }
index 8eb2473..6e4ada3 100644 (file)
@@ -414,7 +414,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
        nfmsg->res_id = htons(queue->queue_num);
 
        pmsg.packet_id          = htonl(entry->id);
-       pmsg.hw_protocol        = htons(entskb->protocol);
+       pmsg.hw_protocol        = entskb->protocol;
        pmsg.hook               = entinf->hook;
 
        NFA_PUT(skb, NFQA_PACKET_HDR, sizeof(pmsg), &pmsg);
index 9f7121a..56958c8 100644 (file)
@@ -4,7 +4,7 @@
 
 config NETLABEL
        bool "NetLabel subsystem support"
-       depends on NET && SECURITY
+       depends on SECURITY
        default n
        ---help---
          NetLabel provides support for explicit network packet labeling