summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-12 19:24:26 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-12 19:24:26 -0800
commitaa5743cc2c4fdd15e65367acc64bbb21a766d197 (patch)
tree465a1c96795f6e25e863e4efdf55a5eed2dd242c
parente45d557978b136ddc8f40656e8fe0be18d8f7a19 (diff)
parentb16f3385ec5fa776684edfe6654736b79ec7fc4e (diff)
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
-rw-r--r--drivers/net/net_init.c341
-rw-r--r--include/linux/netdevice.h5
-rw-r--r--include/linux/pkt_cls.h6
-rw-r--r--include/net/ipv6.h9
-rw-r--r--include/net/tcp.h16
-rw-r--r--net/802/fc.c32
-rw-r--r--net/802/fddi.c41
-rw-r--r--net/802/hippi.c89
-rw-r--r--net/802/tr.c38
-rw-r--r--net/appletalk/Makefile2
-rw-r--r--net/ethernet/eth.c61
-rw-r--r--net/ipv4/tcp_timer.c7
-rw-r--r--net/ipv6/addrconf.c10
-rw-r--r--net/ipv6/anycast.c10
-rw-r--r--net/ipv6/datagram.c2
-rw-r--r--net/ipv6/ip6_fib.c4
-rw-r--r--net/ipv6/ip6_flowlabel.c2
-rw-r--r--net/ipv6/ip6_output.c4
-rw-r--r--net/ipv6/ip6_tunnel.c10
-rw-r--r--net/ipv6/mcast.c37
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/netfilter/ip6_queue.c4
-rw-r--r--net/ipv6/netfilter/ip6t_rt.c4
-rw-r--r--net/ipv6/raw.c8
-rw-r--r--net/ipv6/reassembly.c8
-rw-r--r--net/ipv6/route.c8
-rw-r--r--net/ipv6/tcp_ipv6.c16
-rw-r--r--net/ipv6/udp.c12
-rw-r--r--net/ipv6/xfrm6_policy.c6
-rw-r--r--net/ipv6/xfrm6_state.c6
-rw-r--r--net/sctp/ipv6.c2
31 files changed, 369 insertions, 433 deletions
diff --git a/drivers/net/net_init.c b/drivers/net/net_init.c
index 854bc2b70cee..1f9e0ddf95ca 100644
--- a/drivers/net/net_init.c
+++ b/drivers/net/net_init.c
@@ -105,260 +105,6 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *mask,
}
EXPORT_SYMBOL(alloc_netdev);
-/**
- * alloc_etherdev - Allocates and sets up an ethernet device
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this ethernet device
- *
- * Fill in the fields of the device structure with ethernet-generic
- * values. Basically does everything except registering the device.
- *
- * Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
- * this private data area.
- */
-
-struct net_device *alloc_etherdev(int sizeof_priv)
-{
- return alloc_netdev(sizeof_priv, "eth%d", ether_setup);
-}
-
-EXPORT_SYMBOL(alloc_etherdev);
-
-static int eth_mac_addr(struct net_device *dev, void *p)
-{
- struct sockaddr *addr=p;
- if (netif_running(dev))
- return -EBUSY;
- memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
- return 0;
-}
-
-static int eth_change_mtu(struct net_device *dev, int new_mtu)
-{
- if ((new_mtu < 68) || (new_mtu > 1500))
- return -EINVAL;
- dev->mtu = new_mtu;
- return 0;
-}
-
-#ifdef CONFIG_FDDI
-
-/**
- * alloc_fddidev - Register FDDI device
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this FDDI device
- *
- * Fill in the fields of the device structure with FDDI-generic values.
- *
- * Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
- * this private data area.
- */
-
-struct net_device *alloc_fddidev(int sizeof_priv)
-{
- return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup);
-}
-
-EXPORT_SYMBOL(alloc_fddidev);
-
-static int fddi_change_mtu(struct net_device *dev, int new_mtu)
-{
- if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN))
- return(-EINVAL);
- dev->mtu = new_mtu;
- return(0);
-}
-
-#endif /* CONFIG_FDDI */
-
-#ifdef CONFIG_HIPPI
-
-static int hippi_change_mtu(struct net_device *dev, int new_mtu)
-{
- /*
- * HIPPI's got these nice large MTUs.
- */
- if ((new_mtu < 68) || (new_mtu > 65280))
- return -EINVAL;
- dev->mtu = new_mtu;
- return(0);
-}
-
-
-/*
- * For HIPPI we will actually use the lower 4 bytes of the hardware
- * address as the I-FIELD rather than the actual hardware address.
- */
-static int hippi_mac_addr(struct net_device *dev, void *p)
-{
- struct sockaddr *addr = p;
- if (netif_running(dev))
- return -EBUSY;
- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- return 0;
-}
-
-static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
-{
- /* Never send broadcast/multicast ARP messages */
- p->mcast_probes = 0;
-
- /* In IPv6 unicast probes are valid even on NBMA,
- * because they are encapsulated in normal IPv6 protocol.
- * Should be a generic flag.
- */
- if (p->tbl->family != AF_INET6)
- p->ucast_probes = 0;
- return 0;
-}
-
-static void hippi_setup(struct net_device *dev)
-{
- dev->set_multicast_list = NULL;
- dev->change_mtu = hippi_change_mtu;
- dev->hard_header = hippi_header;
- dev->rebuild_header = hippi_rebuild_header;
- dev->set_mac_address = hippi_mac_addr;
- dev->hard_header_parse = NULL;
- dev->hard_header_cache = NULL;
- dev->header_cache_update = NULL;
- dev->neigh_setup = hippi_neigh_setup_dev;
-
- /*
- * We don't support HIPPI `ARP' for the time being, and probably
- * never will unless someone else implements it. However we
- * still need a fake ARPHRD to make ifconfig and friends play ball.
- */
- dev->type = ARPHRD_HIPPI;
- dev->hard_header_len = HIPPI_HLEN;
- dev->mtu = 65280;
- dev->addr_len = HIPPI_ALEN;
- dev->tx_queue_len = 25 /* 5 */;
- memset(dev->broadcast, 0xFF, HIPPI_ALEN);
-
-
- /*
- * HIPPI doesn't support broadcast+multicast and we only use
- * static ARP tables. ARP is disabled by hippi_neigh_setup_dev.
- */
- dev->flags = 0;
-}
-
-/**
- * alloc_hippi_dev - Register HIPPI device
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this HIPPI device
- *
- * Fill in the fields of the device structure with HIPPI-generic values.
- *
- * Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
- * this private data area.
- */
-
-struct net_device *alloc_hippi_dev(int sizeof_priv)
-{
- return alloc_netdev(sizeof_priv, "hip%d", hippi_setup);
-}
-
-EXPORT_SYMBOL(alloc_hippi_dev);
-
-#endif /* CONFIG_HIPPI */
-
-void ether_setup(struct net_device *dev)
-{
- /* Fill in the fields of the device structure with ethernet-generic values.
- This should be in a common file instead of per-driver. */
-
- dev->change_mtu = eth_change_mtu;
- dev->hard_header = eth_header;
- dev->rebuild_header = eth_rebuild_header;
- dev->set_mac_address = eth_mac_addr;
- dev->hard_header_cache = eth_header_cache;
- dev->header_cache_update= eth_header_cache_update;
- dev->hard_header_parse = eth_header_parse;
-
- dev->type = ARPHRD_ETHER;
- dev->hard_header_len = ETH_HLEN;
- dev->mtu = 1500; /* eth_mtu */
- dev->addr_len = ETH_ALEN;
- dev->tx_queue_len = 1000; /* Ethernet wants good queues */
-
- memset(dev->broadcast,0xFF, ETH_ALEN);
-
- /* New-style flags. */
- dev->flags = IFF_BROADCAST|IFF_MULTICAST;
-}
-EXPORT_SYMBOL(ether_setup);
-
-#ifdef CONFIG_FDDI
-
-void fddi_setup(struct net_device *dev)
-{
- /*
- * Fill in the fields of the device structure with FDDI-generic values.
- * This should be in a common file instead of per-driver.
- */
-
- dev->change_mtu = fddi_change_mtu;
- dev->hard_header = fddi_header;
- dev->rebuild_header = fddi_rebuild_header;
-
- dev->type = ARPHRD_FDDI;
- dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */
- dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */
- dev->addr_len = FDDI_K_ALEN;
- dev->tx_queue_len = 100; /* Long queues on FDDI */
-
- memset(dev->broadcast, 0xFF, FDDI_K_ALEN);
-
- /* New-style flags */
- dev->flags = IFF_BROADCAST | IFF_MULTICAST;
-}
-EXPORT_SYMBOL(fddi_setup);
-
-#endif /* CONFIG_FDDI */
-
-#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE)
-
-static int ltalk_change_mtu(struct net_device *dev, int mtu)
-{
- return -EINVAL;
-}
-
-static int ltalk_mac_addr(struct net_device *dev, void *addr)
-{
- return -EINVAL;
-}
-
-
-void ltalk_setup(struct net_device *dev)
-{
- /* Fill in the fields of the device structure with localtalk-generic values. */
-
- dev->change_mtu = ltalk_change_mtu;
- dev->hard_header = NULL;
- dev->rebuild_header = NULL;
- dev->set_mac_address = ltalk_mac_addr;
- dev->hard_header_cache = NULL;
- dev->header_cache_update= NULL;
-
- dev->type = ARPHRD_LOCALTLK;
- dev->hard_header_len = LTALK_HLEN;
- dev->mtu = LTALK_MTU;
- dev->addr_len = LTALK_ALEN;
- dev->tx_queue_len = 10;
-
- dev->broadcast[0] = 0xFF;
-
- dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP;
-}
-EXPORT_SYMBOL(ltalk_setup);
-
-#endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */
-
int register_netdev(struct net_device *dev)
{
int err;
@@ -404,90 +150,3 @@ void unregister_netdev(struct net_device *dev)
EXPORT_SYMBOL(register_netdev);
EXPORT_SYMBOL(unregister_netdev);
-
-#ifdef CONFIG_TR
-
-void tr_setup(struct net_device *dev)
-{
- /*
- * Configure and register
- */
-
- dev->hard_header = tr_header;
- dev->rebuild_header = tr_rebuild_header;
-
- dev->type = ARPHRD_IEEE802_TR;
- dev->hard_header_len = TR_HLEN;
- dev->mtu = 2000;
- dev->addr_len = TR_ALEN;
- dev->tx_queue_len = 100; /* Long queues on tr */
-
- memset(dev->broadcast,0xFF, TR_ALEN);
-
- /* New-style flags. */
- dev->flags = IFF_BROADCAST | IFF_MULTICAST ;
-}
-
-/**
- * alloc_trdev - Register token ring device
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this token ring device
- *
- * Fill in the fields of the device structure with token ring-generic values.
- *
- * Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
- * this private data area.
- */
-
-struct net_device *alloc_trdev(int sizeof_priv)
-{
- return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
-}
-
-EXPORT_SYMBOL(tr_setup);
-EXPORT_SYMBOL(alloc_trdev);
-
-#endif /* CONFIG_TR */
-
-#ifdef CONFIG_NET_FC
-
-void fc_setup(struct net_device *dev)
-{
- dev->hard_header = fc_header;
- dev->rebuild_header = fc_rebuild_header;
-
- dev->type = ARPHRD_IEEE802;
- dev->hard_header_len = FC_HLEN;
- dev->mtu = 2024;
- dev->addr_len = FC_ALEN;
- dev->tx_queue_len = 100; /* Long queues on fc */
-
- memset(dev->broadcast,0xFF, FC_ALEN);
-
- /* New-style flags. */
- dev->flags = IFF_BROADCAST;
-}
-
-/**
- * alloc_fcdev - Register fibre channel device
- * @sizeof_priv: Size of additional driver-private structure to be allocated
- * for this fibre channel device
- *
- * Fill in the fields of the device structure with fibre channel-generic values.
- *
- * Constructs a new net device, complete with a private data area of
- * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
- * this private data area.
- */
-
-struct net_device *alloc_fcdev(int sizeof_priv)
-{
- return alloc_netdev(sizeof_priv, "fc%d", fc_setup);
-}
-
-EXPORT_SYMBOL(fc_setup);
-EXPORT_SYMBOL(alloc_fcdev);
-
-#endif /* CONFIG_NET_FC */
-
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9fa9c7ead784..c880b0ee02b3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -902,10 +902,7 @@ static inline void netif_tx_disable(struct net_device *dev)
/* These functions live elsewhere (drivers/net/net_init.c, but related) */
extern void ether_setup(struct net_device *dev);
-extern void fddi_setup(struct net_device *dev);
-extern void tr_setup(struct net_device *dev);
-extern void fc_setup(struct net_device *dev);
-extern void fc_freedev(struct net_device *dev);
+
/* Support for loadable net-drivers */
extern struct net_device *alloc_netdev(int sizeof_priv, const char *name,
void (*setup)(struct net_device *));
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index de9e1311ecbf..45ac289f1bbf 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -138,9 +138,9 @@ struct tc_police
struct tcf_t
{
- __u32 install;
- __u32 lastuse;
- __u32 expires;
+ __u64 install;
+ __u64 lastuse;
+ __u64 expires;
};
struct tc_cnt
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index e0e3800a9560..445fbfd71589 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -296,6 +296,15 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
}
#endif
+static inline int ipv6_addr_equal(const struct in6_addr *a1,
+ const struct in6_addr *a2)
+{
+ return (a1->s6_addr32[0] == a2->s6_addr32[0] &&
+ a1->s6_addr32[1] == a2->s6_addr32[1] &&
+ a1->s6_addr32[2] == a2->s6_addr32[2] &&
+ a1->s6_addr32[3] == a2->s6_addr32[3]);
+}
+
static inline int ipv6_addr_any(const struct in6_addr *a)
{
return ((a->s6_addr32[0] | a->s6_addr32[1] |
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4a7dc4157df4..f5bac4c9b704 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -361,8 +361,8 @@ extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw);
#define TCP_IPV6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \
(((*((__u32 *)&(inet_sk(__sk)->dport)))== (__ports)) && \
((__sk)->sk_family == AF_INET6) && \
- !ipv6_addr_cmp(&inet6_sk(__sk)->daddr, (__saddr)) && \
- !ipv6_addr_cmp(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
+ ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
+ ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
(!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
/* These can have wildcards, don't try too hard. */
@@ -965,7 +965,9 @@ extern void tcp_reset_keepalive_timer(struct sock *, unsigned long);
extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu);
extern unsigned int tcp_current_mss(struct sock *sk, int large);
-extern const char timer_bug_msg[];
+#ifdef TCP_DEBUG
+extern const char tcp_timer_bug_msg[];
+#endif
/* tcp_diag.c */
extern void tcp_get_info(struct sock *, struct tcp_info *);
@@ -998,7 +1000,9 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
#endif
break;
default:
- printk(timer_bug_msg);
+#ifdef TCP_DEBUG
+ printk(tcp_timer_bug_msg);
+#endif
return;
};
@@ -1033,7 +1037,9 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
break;
default:
- printk(timer_bug_msg);
+#ifdef TCP_DEBUG
+ printk(tcp_timer_bug_msg);
+#endif
};
}
diff --git a/net/802/fc.c b/net/802/fc.c
index e7009186a822..9a502820f7f8 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -129,3 +129,35 @@ fc_type_trans(struct sk_buff *skb, struct net_device *dev)
return ntohs(ETH_P_802_2);
}
+
+static void fc_setup(struct net_device *dev)
+{
+ dev->hard_header = fc_header;
+ dev->rebuild_header = fc_rebuild_header;
+
+ dev->type = ARPHRD_IEEE802;
+ dev->hard_header_len = FC_HLEN;
+ dev->mtu = 2024;
+ dev->addr_len = FC_ALEN;
+ dev->tx_queue_len = 100; /* Long queues on fc */
+ dev->flags = IFF_BROADCAST;
+
+ memset(dev->broadcast, 0xFF, FC_ALEN);
+}
+
+/**
+ * alloc_fcdev - Register fibre channel device
+ * @sizeof_priv: Size of additional driver-private structure to be allocated
+ * for this fibre channel device
+ *
+ * Fill in the fields of the device structure with fibre channel-generic values.
+ *
+ * Constructs a new net device, complete with a private data area of
+ * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * this private data area.
+ */
+struct net_device *alloc_fcdev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "fc%d", fc_setup);
+}
+EXPORT_SYMBOL(alloc_fcdev);
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 066025f39fd9..752d77d37d3e 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -166,3 +166,44 @@ unsigned short fddi_type_trans(struct sk_buff *skb, struct net_device *dev)
}
EXPORT_SYMBOL(fddi_type_trans);
+
+static int fddi_change_mtu(struct net_device *dev, int new_mtu)
+{
+ if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN))
+ return(-EINVAL);
+ dev->mtu = new_mtu;
+ return(0);
+}
+
+static void fddi_setup(struct net_device *dev)
+{
+ dev->change_mtu = fddi_change_mtu;
+ dev->hard_header = fddi_header;
+ dev->rebuild_header = fddi_rebuild_header;
+
+ dev->type = ARPHRD_FDDI;
+ dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */
+ dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */
+ dev->addr_len = FDDI_K_ALEN;
+ dev->tx_queue_len = 100; /* Long queues on FDDI */
+ dev->flags = IFF_BROADCAST | IFF_MULTICAST;
+
+ memset(dev->broadcast, 0xFF, FDDI_K_ALEN);
+}
+
+/**
+ * alloc_fddidev - Register FDDI device
+ * @sizeof_priv: Size of additional driver-private structure to be allocated
+ * for this FDDI device
+ *
+ * Fill in the fields of the device structure with FDDI-generic values.
+ *
+ * Constructs a new net device, complete with a private data area of
+ * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * this private data area.
+ */
+struct net_device *alloc_fddidev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup);
+}
+EXPORT_SYMBOL(alloc_fddidev);
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 7ae2797eef25..bb66e0315276 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -154,3 +154,92 @@ unsigned short hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
}
EXPORT_SYMBOL(hippi_type_trans);
+
+static int hippi_change_mtu(struct net_device *dev, int new_mtu)
+{
+ /*
+ * HIPPI's got these nice large MTUs.
+ */
+ if ((new_mtu < 68) || (new_mtu > 65280))
+ return -EINVAL;
+ dev->mtu = new_mtu;
+ return(0);
+}
+
+/*
+ * For HIPPI we will actually use the lower 4 bytes of the hardware
+ * address as the I-FIELD rather than the actual hardware address.
+ */
+static int hippi_mac_addr(struct net_device *dev, void *p)
+{
+ struct sockaddr *addr = p;
+ if (netif_running(dev))
+ return -EBUSY;
+ memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+ return 0;
+}
+
+static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
+{
+ /* Never send broadcast/multicast ARP messages */
+ p->mcast_probes = 0;
+
+ /* In IPv6 unicast probes are valid even on NBMA,
+ * because they are encapsulated in normal IPv6 protocol.
+ * Should be a generic flag.
+ */
+ if (p->tbl->family != AF_INET6)
+ p->ucast_probes = 0;
+ return 0;
+}
+
+static void hippi_setup(struct net_device *dev)
+{
+ dev->set_multicast_list = NULL;
+ dev->change_mtu = hippi_change_mtu;
+ dev->hard_header = hippi_header;
+ dev->rebuild_header = hippi_rebuild_header;
+ dev->set_mac_address = hippi_mac_addr;
+ dev->hard_header_parse = NULL;
+ dev->hard_header_cache = NULL;
+ dev->header_cache_update = NULL;
+ dev->neigh_setup = hippi_neigh_setup_dev;
+
+ /*
+ * We don't support HIPPI `ARP' for the time being, and probably
+ * never will unless someone else implements it. However we
+ * still need a fake ARPHRD to make ifconfig and friends play ball.
+ */
+ dev->type = ARPHRD_HIPPI;
+ dev->hard_header_len = HIPPI_HLEN;
+ dev->mtu = 65280;
+ dev->addr_len = HIPPI_ALEN;
+ dev->tx_queue_len = 25 /* 5 */;
+ memset(dev->broadcast, 0xFF, HIPPI_ALEN);
+
+
+ /*
+ * HIPPI doesn't support broadcast+multicast and we only use
+ * static ARP tables. ARP is disabled by hippi_neigh_setup_dev.
+ */
+ dev->flags = 0;
+}
+
+/**
+ * alloc_hippi_dev - Register HIPPI device
+ * @sizeof_priv: Size of additional driver-private structure to be allocated
+ * for this HIPPI device
+ *
+ * Fill in the fields of the device structure with HIPPI-generic values.
+ *
+ * Constructs a new net device, complete with a private data area of
+ * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * this private data area.
+ */
+
+struct net_device *alloc_hippi_dev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "hip%d", hippi_setup);
+}
+
+EXPORT_SYMBOL(alloc_hippi_dev);
diff --git a/net/802/tr.c b/net/802/tr.c
index bd22ae2aabff..c3a659d4ee7e 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -583,6 +583,43 @@ static struct file_operations rif_seq_fops = {
#endif
+static void tr_setup(struct net_device *dev)
+{
+ /*
+ * Configure and register
+ */
+
+ dev->hard_header = tr_header;
+ dev->rebuild_header = tr_rebuild_header;
+
+ dev->type = ARPHRD_IEEE802_TR;
+ dev->hard_header_len = TR_HLEN;
+ dev->mtu = 2000;
+ dev->addr_len = TR_ALEN;
+ dev->tx_queue_len = 100; /* Long queues on tr */
+
+ memset(dev->broadcast,0xFF, TR_ALEN);
+
+ /* New-style flags. */
+ dev->flags = IFF_BROADCAST | IFF_MULTICAST ;
+}
+
+/**
+ * alloc_trdev - Register token ring device
+ * @sizeof_priv: Size of additional driver-private structure to be allocated
+ * for this token ring device
+ *
+ * Fill in the fields of the device structure with token ring-generic values.
+ *
+ * Constructs a new net device, complete with a private data area of
+ * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * this private data area.
+ */
+struct net_device *alloc_trdev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
+}
+
/*
* Called during bootup. We don't actually have to initialise
* too much for this.
@@ -604,3 +641,4 @@ module_init(rif_init);
EXPORT_SYMBOL(tr_source_route);
EXPORT_SYMBOL(tr_type_trans);
+EXPORT_SYMBOL(alloc_trdev);
diff --git a/net/appletalk/Makefile b/net/appletalk/Makefile
index d179728ad522..5cda56edef57 100644
--- a/net/appletalk/Makefile
+++ b/net/appletalk/Makefile
@@ -4,6 +4,6 @@
obj-$(CONFIG_ATALK) += appletalk.o
-appletalk-y := aarp.o ddp.o
+appletalk-y := aarp.o ddp.o dev.o
appletalk-$(CONFIG_PROC_FS) += atalk_proc.o
appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index a238f92ec37c..5a3a14a72e6d 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -245,3 +245,64 @@ void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsign
}
EXPORT_SYMBOL(eth_type_trans);
+
+static int eth_mac_addr(struct net_device *dev, void *p)
+{
+ struct sockaddr *addr=p;
+ if (netif_running(dev))
+ return -EBUSY;
+ memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
+ return 0;
+}
+
+static int eth_change_mtu(struct net_device *dev, int new_mtu)
+{
+ if ((new_mtu < 68) || (new_mtu > 1500))
+ return -EINVAL;
+ dev->mtu = new_mtu;
+ return 0;
+}
+
+/*
+ * Fill in the fields of the device structure with ethernet-generic values.
+ */
+void ether_setup(struct net_device *dev)
+{
+ dev->change_mtu = eth_change_mtu;
+ dev->hard_header = eth_header;
+ dev->rebuild_header = eth_rebuild_header;
+ dev->set_mac_address = eth_mac_addr;
+ dev->hard_header_cache = eth_header_cache;
+ dev->header_cache_update= eth_header_cache_update;
+ dev->hard_header_parse = eth_header_parse;
+
+ dev->type = ARPHRD_ETHER;
+ dev->hard_header_len = ETH_HLEN;
+ dev->mtu = 1500; /* eth_mtu */
+ dev->addr_len = ETH_ALEN;
+ dev->tx_queue_len = 1000; /* Ethernet wants good queues */
+ dev->flags = IFF_BROADCAST|IFF_MULTICAST;
+
+ memset(dev->broadcast,0xFF, ETH_ALEN);
+
+}
+EXPORT_SYMBOL(ether_setup);
+
+/**
+ * alloc_etherdev - Allocates and sets up an ethernet device
+ * @sizeof_priv: Size of additional driver-private structure to be allocated
+ * for this ethernet device
+ *
+ * Fill in the fields of the device structure with ethernet-generic
+ * values. Basically does everything except registering the device.
+ *
+ * Constructs a new net device, complete with a private data area of
+ * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for
+ * this private data area.
+ */
+
+struct net_device *alloc_etherdev(int sizeof_priv)
+{
+ return alloc_netdev(sizeof_priv, "eth%d", ether_setup);
+}
+EXPORT_SYMBOL(alloc_etherdev);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index c060bb333471..3b4d82176a84 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -36,7 +36,9 @@ static void tcp_write_timer(unsigned long);
static void tcp_delack_timer(unsigned long);
static void tcp_keepalive_timer (unsigned long data);
-const char timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
+#ifdef TCP_DEBUG
+const char tcp_timer_bug_msg[] = KERN_DEBUG "tcpbug: unknown timer value\n";
+#endif
/*
* Using different timers for retransmit, delayed acks and probes
@@ -651,3 +653,6 @@ EXPORT_SYMBOL(tcp_clear_xmit_timers);
EXPORT_SYMBOL(tcp_delete_keepalive_timer);
EXPORT_SYMBOL(tcp_init_xmit_timers);
EXPORT_SYMBOL(tcp_reset_keepalive_timer);
+#ifdef TCP_DEBUG
+EXPORT_SYMBOL(tcp_timer_bug_msg);
+#endif
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1b8250f857ed..808bb73b178e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -921,7 +921,7 @@ int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev, int strict)
read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
- if (ipv6_addr_cmp(&ifp->addr, addr) == 0 &&
+ if (ipv6_addr_equal(&ifp->addr, addr) &&
!(ifp->flags&IFA_F_TENTATIVE)) {
if (dev == NULL || ifp->idev->dev == dev ||
!(ifp->scope&(IFA_LINK|IFA_HOST) || strict))
@@ -940,7 +940,7 @@ int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev)
read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
- if (ipv6_addr_cmp(&ifp->addr, addr) == 0) {
+ if (ipv6_addr_equal(&ifp->addr, addr)) {
if (dev == NULL || ifp->idev->dev == dev)
break;
}
@@ -956,7 +956,7 @@ struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *
read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) {
- if (ipv6_addr_cmp(&ifp->addr, addr) == 0) {
+ if (ipv6_addr_equal(&ifp->addr, addr)) {
if (dev == NULL || ifp->idev->dev == dev ||
!(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) {
in6_ifa_hold(ifp);
@@ -992,7 +992,7 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
return 1;
if (sk2_rcv_saddr6 &&
- !ipv6_addr_cmp(sk_rcv_saddr6, sk2_rcv_saddr6))
+ ipv6_addr_equal(sk_rcv_saddr6, sk2_rcv_saddr6))
return 1;
if (addr_type == IPV6_ADDR_MAPPED &&
@@ -1630,7 +1630,7 @@ static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen)
read_lock_bh(&idev->lock);
for (ifp = idev->addr_list; ifp; ifp=ifp->if_next) {
if (ifp->prefix_len == plen &&
- (!memcmp(pfx, &ifp->addr, sizeof(struct in6_addr)))) {
+ ipv6_addr_equal(pfx, &ifp->addr)) {
in6_ifa_hold(ifp);
read_unlock_bh(&idev->lock);
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index d0d58c83bc06..959947f56e9f 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -205,7 +205,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
prev_pac = NULL;
for (pac = np->ipv6_ac_list; pac; pac = pac->acl_next) {
if ((ifindex == 0 || pac->acl_ifindex == ifindex) &&
- ipv6_addr_cmp(&pac->acl_addr, addr) == 0)
+ ipv6_addr_equal(&pac->acl_addr, addr))
break;
prev_pac = pac;
}
@@ -278,7 +278,7 @@ int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex)
for (pac=np->ipv6_ac_list; pac; pac=pac->acl_next) {
if (ifindex && pac->acl_ifindex != ifindex)
continue;
- found = ipv6_addr_cmp(&pac->acl_addr, addr) == 0;
+ found = ipv6_addr_equal(&pac->acl_addr, addr);
if (found)
break;
}
@@ -320,7 +320,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr)
}
for (aca = idev->ac_list; aca; aca = aca->aca_next) {
- if (ipv6_addr_cmp(&aca->aca_addr, addr) == 0) {
+ if (ipv6_addr_equal(&aca->aca_addr, addr)) {
aca->aca_users++;
err = 0;
goto out;
@@ -384,7 +384,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr)
write_lock_bh(&idev->lock);
prev_aca = NULL;
for (aca = idev->ac_list; aca; aca = aca->aca_next) {
- if (ipv6_addr_cmp(&aca->aca_addr, addr) == 0)
+ if (ipv6_addr_equal(&aca->aca_addr, addr))
break;
prev_aca = aca;
}
@@ -436,7 +436,7 @@ static int ipv6_chk_acast_dev(struct net_device *dev, struct in6_addr *addr)
if (idev) {
read_lock_bh(&idev->lock);
for (aca = idev->ac_list; aca; aca = aca->aca_next)
- if (ipv6_addr_cmp(&aca->aca_addr, addr) == 0)
+ if (ipv6_addr_equal(&aca->aca_addr, addr))
break;
read_unlock_bh(&idev->lock);
in6_dev_put(idev);
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 5e0aecb2d011..770284e5e7c9 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -190,7 +190,7 @@ ipv4_connected:
}
ip6_dst_store(sk, dst,
- !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
+ ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
&np->daddr : NULL);
sk->sk_state = TCP_ESTABLISHED;
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index d394bd2d0285..798d78cb242f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -451,8 +451,8 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
if (iter->rt6i_dev == rt->rt6i_dev &&
iter->rt6i_idev == rt->rt6i_idev &&
- ipv6_addr_cmp(&iter->rt6i_gateway,
- &rt->rt6i_gateway) == 0) {
+ ipv6_addr_equal(&iter->rt6i_gateway,
+ &rt->rt6i_gateway)) {
if (!(iter->rt6i_flags&RTF_EXPIRES))
return -EEXIST;
iter->rt6i_expires = rt->rt6i_expires;
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 15f341adc74c..1803f46755aa 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -500,7 +500,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
goto release;
err = -EINVAL;
- if (ipv6_addr_cmp(&fl1->dst, &fl->dst) ||
+ if (!ipv6_addr_equal(&fl1->dst, &fl->dst) ||
ipv6_opt_cmp(fl1->opt, fl->opt))
goto release;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index e74a46201ef1..fe36c95fc72d 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -768,9 +768,9 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
*/
if (((rt->rt6i_dst.plen != 128 ||
- ipv6_addr_cmp(&fl->fl6_dst, &rt->rt6i_dst.addr))
+ !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr))
&& (np->daddr_cache == NULL ||
- ipv6_addr_cmp(&fl->fl6_dst, np->daddr_cache)))
+ !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache)))
|| (fl->oif && fl->oif != (*dst)->dev->ifindex)) {
*dst = NULL;
} else
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index c75dc343bfa6..742f0e493652 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -133,8 +133,8 @@ ip6ip6_tnl_lookup(struct in6_addr *remote, struct in6_addr *local)
struct ip6_tnl *t;
for (t = tnls_r_l[h0 ^ h1]; t; t = t->next) {
- if (!ipv6_addr_cmp(local, &t->parms.laddr) &&
- !ipv6_addr_cmp(remote, &t->parms.raddr) &&
+ if (ipv6_addr_equal(local, &t->parms.laddr) &&
+ ipv6_addr_equal(remote, &t->parms.raddr) &&
(t->dev->flags & IFF_UP))
return t;
}
@@ -284,8 +284,8 @@ ip6ip6_tnl_locate(struct ip6_tnl_parm *p, struct ip6_tnl **pt, int create)
return -EINVAL;
for (t = *ip6ip6_bucket(p); t; t = t->next) {
- if (!ipv6_addr_cmp(local, &t->parms.laddr) &&
- !ipv6_addr_cmp(remote, &t->parms.raddr)) {
+ if (ipv6_addr_equal(local, &t->parms.laddr) &&
+ ipv6_addr_equal(remote, &t->parms.raddr)) {
*pt = t;
return (create ? -EEXIST : 0);
}
@@ -602,7 +602,7 @@ static inline struct ipv6_txoptions *create_tel(__u8 encap_limit)
static inline int
ip6ip6_tnl_addr_conflict(struct ip6_tnl *t, struct ipv6hdr *hdr)
{
- return !ipv6_addr_cmp(&t->parms.raddr, &hdr->saddr);
+ return ipv6_addr_equal(&t->parms.raddr, &hdr->saddr);
}
/**
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index d8f4a411f39b..b3243770978f 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -247,7 +247,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
write_lock_bh(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list; (mc_lst = *lnk) !=NULL ; lnk = &mc_lst->next) {
if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
- ipv6_addr_cmp(&mc_lst->addr, addr) == 0) {
+ ipv6_addr_equal(&mc_lst->addr, addr)) {
struct net_device *dev;
*lnk = mc_lst->next;
@@ -369,7 +369,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface)
continue;
- if (ipv6_addr_cmp(&pmc->addr, group) == 0)
+ if (ipv6_addr_equal(&pmc->addr, group))
break;
}
if (!pmc) /* must have a prior join */
@@ -485,7 +485,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pmc->ifindex != gsf->gf_interface)
continue;
- if (ipv6_addr_cmp(&pmc->addr, group) == 0)
+ if (ipv6_addr_equal(&pmc->addr, group))
break;
}
if (!pmc) /* must have a prior join */
@@ -556,7 +556,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pmc->ifindex != gsf->gf_interface)
continue;
- if (ipv6_addr_cmp(group, &pmc->addr) == 0)
+ if (ipv6_addr_equal(group, &pmc->addr))
break;
}
if (!pmc) /* must have a prior join */
@@ -603,7 +603,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
read_lock(&ipv6_sk_mc_lock);
for (mc = np->ipv6_mc_list; mc; mc = mc->next) {
- if (ipv6_addr_cmp(&mc->addr, mc_addr) == 0)
+ if (ipv6_addr_equal(&mc->addr, mc_addr))
break;
}
if (!mc) {
@@ -617,7 +617,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
int i;
for (i=0; i<psl->sl_count; i++) {
- if (ipv6_addr_cmp(&psl->sl_addr[i], src_addr) == 0)
+ if (ipv6_addr_equal(&psl->sl_addr[i], src_addr))
break;
}
if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count)
@@ -740,7 +740,7 @@ static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca)
write_lock_bh(&idev->mc_lock);
pmc_prev = NULL;
for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) {
- if (ipv6_addr_cmp(&pmc->mca_addr, pmca) == 0)
+ if (ipv6_addr_equal(&pmc->mca_addr, pmca))
break;
pmc_prev = pmc;
}
@@ -816,7 +816,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr)
}
for (mc = idev->mc_list; mc; mc = mc->next) {
- if (ipv6_addr_cmp(&mc->mca_addr, addr) == 0) {
+ if (ipv6_addr_equal(&mc->mca_addr, addr)) {
mc->mca_users++;
write_unlock_bh(&idev->lock);
ip6_mc_add_src(idev, &mc->mca_addr, MCAST_EXCLUDE, 0,
@@ -878,7 +878,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
write_lock_bh(&idev->lock);
for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) {
- if (ipv6_addr_cmp(&ma->mca_addr, addr) == 0) {
+ if (ipv6_addr_equal(&ma->mca_addr, addr)) {
if (--ma->mca_users == 0) {
*map = ma->next;
write_unlock_bh(&idev->lock);
@@ -953,7 +953,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
if (idev) {
read_lock_bh(&idev->lock);
for (mc = idev->mc_list; mc; mc=mc->next) {
- if (ipv6_addr_cmp(&mc->mca_addr, group) == 0)
+ if (ipv6_addr_equal(&mc->mca_addr, group))
break;
}
if (mc) {
@@ -962,8 +962,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
spin_lock_bh(&mc->mca_lock);
for (psf=mc->mca_sources;psf;psf=psf->sf_next) {
- if (ipv6_addr_cmp(&psf->sf_addr,
- src_addr) == 0)
+ if (ipv6_addr_equal(&psf->sf_addr, src_addr))
break;
}
if (psf)
@@ -1040,7 +1039,7 @@ static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
if (scount == nsrcs)
break;
for (i=0; i<nsrcs; i++)
- if (ipv6_addr_cmp(&srcs[i], &psf->sf_addr) == 0) {
+ if (ipv6_addr_equal(&srcs[i], &psf->sf_addr)) {
psf->sf_gsresp = 1;
scount++;
break;
@@ -1135,7 +1134,7 @@ int igmp6_event_query(struct sk_buff *skb)
} else {
for (ma = idev->mc_list; ma; ma=ma->next) {
if (group_type != IPV6_ADDR_ANY &&
- ipv6_addr_cmp(group, &ma->mca_addr) != 0)
+ !ipv6_addr_equal(group, &ma->mca_addr))
continue;
spin_lock_bh(&ma->mca_lock);
if (ma->mca_flags & MAF_TIMER_RUNNING) {
@@ -1200,7 +1199,7 @@ int igmp6_event_report(struct sk_buff *skb)
read_lock_bh(&idev->lock);
for (ma = idev->mc_list; ma; ma=ma->next) {
- if (ipv6_addr_cmp(&ma->mca_addr, addrp) == 0) {
+ if (ipv6_addr_equal(&ma->mca_addr, addrp)) {
spin_lock(&ma->mca_lock);
if (del_timer(&ma->mca_timer))
atomic_dec(&ma->mca_refcnt);
@@ -1695,7 +1694,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
psf_prev = NULL;
for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
- if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0)
+ if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
break;
psf_prev = psf;
}
@@ -1735,7 +1734,7 @@ int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode,
return -ENODEV;
read_lock_bh(&idev->lock);
for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
- if (ipv6_addr_cmp(pmca, &pmc->mca_addr) == 0)
+ if (ipv6_addr_equal(pmca, &pmc->mca_addr))
break;
}
if (!pmc) {
@@ -1790,7 +1789,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
psf_prev = NULL;
for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
- if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0)
+ if (ipv6_addr_equal(&psf->sf_addr, psfsrc))
break;
psf_prev = psf;
}
@@ -1859,7 +1858,7 @@ int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode,
return -ENODEV;
read_lock_bh(&idev->lock);
for (pmc=idev->mc_list; pmc; pmc=pmc->next) {
- if (ipv6_addr_cmp(pmca, &pmc->mca_addr) == 0)
+ if (ipv6_addr_equal(pmca, &pmc->mca_addr))
break;
}
if (!pmc) {
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index b940f2d666c3..aa822e72afb8 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1219,7 +1219,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
return;
}
- if (ipv6_addr_cmp(dest, target) == 0) {
+ if (ipv6_addr_equal(dest, target)) {
on_link = 1;
} else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) {
ND_PRINTK2(KERN_WARNING
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 75f9ac7b891e..9d10860e8f43 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -376,8 +376,8 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
*/
if (e->info->hook == NF_IP_LOCAL_OUT) {
struct ipv6hdr *iph = e->skb->nh.ipv6h;
- if (ipv6_addr_cmp(&iph->daddr, &e->rt_info.daddr) ||
- ipv6_addr_cmp(&iph->saddr, &e->rt_info.saddr))
+ if (!ipv6_addr_equal(&iph->daddr, &e->rt_info.daddr) ||
+ !ipv6_addr_equal(&iph->saddr, &e->rt_info.saddr))
return ip6_route_me_harder(e->skb);
}
return 0;
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c
index b5adc1057a9b..a9526b773d28 100644
--- a/net/ipv6/netfilter/ip6t_rt.c
+++ b/net/ipv6/netfilter/ip6t_rt.c
@@ -209,7 +209,7 @@ match(const struct sk_buff *skb,
BUG_ON(ap == NULL);
- if (!ipv6_addr_cmp(ap, &rtinfo->addrs[i])) {
+ if (ipv6_addr_equal(ap, &rtinfo->addrs[i])) {
DEBUGP("i=%d temp=%d;\n",i,temp);
i++;
}
@@ -236,7 +236,7 @@ match(const struct sk_buff *skb,
&_addr);
BUG_ON(ap == NULL);
- if (ipv6_addr_cmp(ap, &rtinfo->addrs[temp]))
+ if (!ipv6_addr_equal(ap, &rtinfo->addrs[temp]))
break;
}
DEBUGP("temp=%d #%d\n", temp, rtinfo->addrnr);
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index ff920c712d01..8a2c05bbf69a 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -90,11 +90,11 @@ struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
struct ipv6_pinfo *np = inet6_sk(sk);
if (!ipv6_addr_any(&np->daddr) &&
- ipv6_addr_cmp(&np->daddr, rmt_addr))
+ !ipv6_addr_equal(&np->daddr, rmt_addr))
continue;
if (!ipv6_addr_any(&np->rcv_saddr)) {
- if (!ipv6_addr_cmp(&np->rcv_saddr, loc_addr))
+ if (ipv6_addr_equal(&np->rcv_saddr, loc_addr))
goto found;
if (is_multicast &&
inet6_mc_check(sk, loc_addr, rmt_addr))
@@ -668,7 +668,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
* sk->sk_dst_cache.
*/
if (sk->sk_state == TCP_ESTABLISHED &&
- !ipv6_addr_cmp(daddr, &np->daddr))
+ ipv6_addr_equal(daddr, &np->daddr))
daddr = &np->daddr;
if (addr_len >= sizeof(struct sockaddr_in6) &&
@@ -775,7 +775,7 @@ back_from_confirm:
}
done:
ip6_dst_store(sk, dst,
- !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
+ ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
&np->daddr : NULL);
if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0;
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index b9450cbcc962..f69b3f9c5bc3 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -342,8 +342,8 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash,
#ifdef CONFIG_SMP
for (fq = ip6_frag_hash[hash]; fq; fq = fq->next) {
if (fq->id == fq_in->id &&
- !ipv6_addr_cmp(&fq_in->saddr, &fq->saddr) &&
- !ipv6_addr_cmp(&fq_in->daddr, &fq->daddr)) {
+ ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
+ ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
atomic_inc(&fq->refcnt);
write_unlock(&ip6_frag_lock);
fq_in->last_in |= COMPLETE;
@@ -406,8 +406,8 @@ fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst)
read_lock(&ip6_frag_lock);
for(fq = ip6_frag_hash[hash]; fq; fq = fq->next) {
if (fq->id == id &&
- !ipv6_addr_cmp(src, &fq->saddr) &&
- !ipv6_addr_cmp(dst, &fq->daddr)) {
+ ipv6_addr_equal(src, &fq->saddr) &&
+ ipv6_addr_equal(dst, &fq->daddr)) {
atomic_inc(&fq->refcnt);
read_unlock(&ip6_frag_lock);
return fq;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 90e6b13c7380..132f5515b418 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1006,7 +1006,7 @@ static int ip6_route_del(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_r
rt->rt6i_dev->ifindex != rtmsg->rtmsg_ifindex))
continue;
if (rtmsg->rtmsg_flags&RTF_GATEWAY &&
- ipv6_addr_cmp(&rtmsg->rtmsg_gateway, &rt->rt6i_gateway))
+ !ipv6_addr_equal(&rtmsg->rtmsg_gateway, &rt->rt6i_gateway))
continue;
if (rtmsg->rtmsg_metric &&
rtmsg->rtmsg_metric != rt->rt6i_metric)
@@ -1057,13 +1057,13 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr,
* is a bit fuzzy and one might need to check all default
* routers.
*/
- if (ipv6_addr_cmp(saddr, &rt->rt6i_gateway)) {
+ if (!ipv6_addr_equal(saddr, &rt->rt6i_gateway)) {
if (rt->rt6i_flags & RTF_DEFAULT) {
struct rt6_info *rt1;
read_lock(&rt6_lock);
for (rt1 = ip6_routing_table.leaf; rt1; rt1 = rt1->u.next) {
- if (!ipv6_addr_cmp(saddr, &rt1->rt6i_gateway)) {
+ if (ipv6_addr_equal(saddr, &rt1->rt6i_gateway)) {
dst_hold(&rt1->u.dst);
dst_release(&rt->u.dst);
read_unlock(&rt6_lock);
@@ -1262,7 +1262,7 @@ struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *d
write_lock_bh(&rt6_lock);
for (rt = fn->leaf; rt; rt=rt->u.next) {
if (dev == rt->rt6i_dev &&
- ipv6_addr_cmp(&rt->rt6i_gateway, addr) == 0)
+ ipv6_addr_equal(&rt->rt6i_gateway, addr))
break;
}
if (rt)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d6cadb2ceede..0753fb18b3b1 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -262,7 +262,7 @@ static struct sock *tcp_v6_lookup_listener(struct in6_addr *daddr, unsigned shor
score = 1;
if (!ipv6_addr_any(&np->rcv_saddr)) {
- if (ipv6_addr_cmp(&np->rcv_saddr, daddr))
+ if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
continue;
score++;
}
@@ -321,8 +321,8 @@ static inline struct sock *__tcp_v6_lookup_established(struct in6_addr *saddr, u
if(*((__u32 *)&(tw->tw_dport)) == ports &&
sk->sk_family == PF_INET6) {
- if(!ipv6_addr_cmp(&tw->tw_v6_daddr, saddr) &&
- !ipv6_addr_cmp(&tw->tw_v6_rcv_saddr, daddr) &&
+ if(ipv6_addr_equal(&tw->tw_v6_daddr, saddr) &&
+ ipv6_addr_equal(&tw->tw_v6_rcv_saddr, daddr) &&
(!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif))
goto hit;
}
@@ -406,8 +406,8 @@ static struct open_request *tcp_v6_search_req(struct tcp_opt *tp,
prev = &req->dl_next) {
if (req->rmt_port == rport &&
req->class->family == AF_INET6 &&
- !ipv6_addr_cmp(&req->af.v6_req.rmt_addr, raddr) &&
- !ipv6_addr_cmp(&req->af.v6_req.loc_addr, laddr) &&
+ ipv6_addr_equal(&req->af.v6_req.rmt_addr, raddr) &&
+ ipv6_addr_equal(&req->af.v6_req.loc_addr, laddr) &&
(!req->af.v6_req.iif || req->af.v6_req.iif == iif)) {
BUG_TRAP(req->sk == NULL);
*prevp = prev;
@@ -463,8 +463,8 @@ static int tcp_v6_check_established(struct sock *sk)
if(*((__u32 *)&(tw->tw_dport)) == ports &&
sk2->sk_family == PF_INET6 &&
- !ipv6_addr_cmp(&tw->tw_v6_daddr, saddr) &&
- !ipv6_addr_cmp(&tw->tw_v6_rcv_saddr, daddr) &&
+ ipv6_addr_equal(&tw->tw_v6_daddr, saddr) &&
+ ipv6_addr_equal(&tw->tw_v6_rcv_saddr, daddr) &&
sk2->sk_bound_dev_if == sk->sk_bound_dev_if) {
struct tcp_opt *tp = tcp_sk(sk);
@@ -610,7 +610,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
}
if (tp->ts_recent_stamp &&
- ipv6_addr_cmp(&np->daddr, &usin->sin6_addr)) {
+ !ipv6_addr_equal(&np->daddr, &usin->sin6_addr)) {
tp->ts_recent = 0;
tp->ts_recent_stamp = 0;
tp->write_seq = 0;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 8c18a474d5f0..d9b1ed226067 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -171,12 +171,12 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport,
score++;
}
if (!ipv6_addr_any(&np->rcv_saddr)) {
- if (ipv6_addr_cmp(&np->rcv_saddr, daddr))
+ if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
continue;
score++;
}
if (!ipv6_addr_any(&np->daddr)) {
- if (ipv6_addr_cmp(&np->daddr, saddr))
+ if (!ipv6_addr_equal(&np->daddr, saddr))
continue;
score++;
}
@@ -395,14 +395,14 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
continue;
}
if (!ipv6_addr_any(&np->daddr) &&
- ipv6_addr_cmp(&np->daddr, rmt_addr))
+ !ipv6_addr_equal(&np->daddr, rmt_addr))
continue;
if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
continue;
if (!ipv6_addr_any(&np->rcv_saddr)) {
- if (!ipv6_addr_cmp(&np->rcv_saddr, loc_addr))
+ if (ipv6_addr_equal(&np->rcv_saddr, loc_addr))
return s;
continue;
}
@@ -732,7 +732,7 @@ do_udp_sendmsg:
* sk->sk_dst_cache.
*/
if (sk->sk_state == TCP_ESTABLISHED &&
- !ipv6_addr_cmp(daddr, &np->daddr))
+ ipv6_addr_equal(daddr, &np->daddr))
daddr = &np->daddr;
if (addr_len >= sizeof(struct sockaddr_in6) &&
@@ -840,7 +840,7 @@ do_append_data:
if (dst)
ip6_dst_store(sk, dst,
- !ipv6_addr_cmp(&fl->fl6_dst, &np->daddr) ?
+ ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ?
&np->daddr : NULL);
if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0;
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index a0715e2f05d7..f17e340a90fe 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -68,8 +68,8 @@ __xfrm6_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
ipv6_addr_prefix(&fl_src_prefix,
&fl->fl6_src,
xdst->u.rt6.rt6i_src.plen);
- if (!ipv6_addr_cmp(&xdst->u.rt6.rt6i_dst.addr, &fl_dst_prefix) &&
- !ipv6_addr_cmp(&xdst->u.rt6.rt6i_src.addr, &fl_src_prefix) &&
+ if (ipv6_addr_equal(&xdst->u.rt6.rt6i_dst.addr, &fl_dst_prefix) &&
+ ipv6_addr_equal(&xdst->u.rt6.rt6i_src.addr, &fl_src_prefix) &&
__xfrm6_bundle_ok(xdst, fl)) {
dst_clone(dst);
break;
@@ -123,7 +123,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
trailer_len += xfrm[i]->props.trailer_len;
}
- if (ipv6_addr_cmp(remote, &fl->fl6_dst)) {
+ if (!ipv6_addr_equal(remote, &fl->fl6_dst)) {
struct flowi fl_tunnel;
memset(&fl_tunnel, 0, sizeof(fl_tunnel));
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index d98b92d15ea6..6024a1c3cc15 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -55,7 +55,7 @@ __xfrm6_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto)
list_for_each_entry(x, xfrm6_state_afinfo.state_byspi+h, byspi) {
if (x->props.family == AF_INET6 &&
spi == x->id.spi &&
- !ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)x->id.daddr.a6) &&
+ ipv6_addr_equal((struct in6_addr *)daddr, (struct in6_addr *)x->id.daddr.a6) &&
proto == x->id.proto) {
xfrm_state_hold(x);
return x;
@@ -76,10 +76,10 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto,
list_for_each_entry(x, xfrm6_state_afinfo.state_bydst+h, bydst) {
if (x->props.family == AF_INET6 &&
- !ipv6_addr_cmp((struct in6_addr *)daddr, (struct in6_addr *)x->id.daddr.a6) &&
+ ipv6_addr_equal((struct in6_addr *)daddr, (struct in6_addr *)x->id.daddr.a6) &&
mode == x->props.mode &&
proto == x->id.proto &&
- !ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)x->props.saddr.a6) &&
+ ipv6_addr_equal((struct in6_addr *)saddr, (struct in6_addr *)x->props.saddr.a6) &&
reqid == x->props.reqid &&
x->km.state == XFRM_STATE_ACQ &&
!x->id.spi) {
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 8765177be8fb..373690d4ee21 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -461,7 +461,7 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
}
return 0;
}
- if (ipv6_addr_cmp(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
+ if (!ipv6_addr_equal(&addr1->v6.sin6_addr, &addr2->v6.sin6_addr))
return 0;
/* If this is a linklocal address, compare the scope_id. */
if (ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) {