Commit aa5743cc authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents e45d5579 b16f3385
...@@ -105,260 +105,6 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *mask, ...@@ -105,260 +105,6 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *mask,
} }
EXPORT_SYMBOL(alloc_netdev); 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 register_netdev(struct net_device *dev)
{ {
int err; int err;
...@@ -404,90 +150,3 @@ void unregister_netdev(struct net_device *dev) ...@@ -404,90 +150,3 @@ void unregister_netdev(struct net_device *dev)
EXPORT_SYMBOL(register_netdev); EXPORT_SYMBOL(register_netdev);
EXPORT_SYMBOL(unregister_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 */
...@@ -902,10 +902,7 @@ static inline void netif_tx_disable(struct net_device *dev) ...@@ -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) */ /* These functions live elsewhere (drivers/net/net_init.c, but related) */
extern void ether_setup(struct net_device *dev); 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 */ /* Support for loadable net-drivers */
extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, extern struct net_device *alloc_netdev(int sizeof_priv, const char *name,
void (*setup)(struct net_device *)); void (*setup)(struct net_device *));
......
...@@ -138,9 +138,9 @@ struct tc_police ...@@ -138,9 +138,9 @@ struct tc_police
struct tcf_t struct tcf_t
{ {
__u32 install; __u64 install;
__u32 lastuse; __u64 lastuse;
__u32 expires; __u64 expires;
}; };
struct tc_cnt struct tc_cnt
......
...@@ -296,6 +296,15 @@ static inline void ipv6_addr_set(struct in6_addr *addr, ...@@ -296,6 +296,15 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
} }
#endif #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) static inline int ipv6_addr_any(const struct in6_addr *a)
{ {
return ((a->s6_addr32[0] | a->s6_addr32[1] | return ((a->s6_addr32[0] | a->s6_addr32[1] |
......
...@@ -361,8 +361,8 @@ extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw); ...@@ -361,8 +361,8 @@ extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw);
#define TCP_IPV6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ #define TCP_IPV6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \
(((*((__u32 *)&(inet_sk(__sk)->dport)))== (__ports)) && \ (((*((__u32 *)&(inet_sk(__sk)->dport)))== (__ports)) && \
((__sk)->sk_family == AF_INET6) && \ ((__sk)->sk_family == AF_INET6) && \
!ipv6_addr_cmp(&inet6_sk(__sk)->daddr, (__saddr)) && \ ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
!ipv6_addr_cmp(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
(!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
/* These can have wildcards, don't try too hard. */ /* These can have wildcards, don't try too hard. */
...@@ -965,7 +965,9 @@ extern void tcp_reset_keepalive_timer(struct sock *, unsigned long); ...@@ -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_sync_mss(struct sock *sk, u32 pmtu);
extern unsigned int tcp_current_mss(struct sock *sk, int large); 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 */ /* tcp_diag.c */
extern void tcp_get_info(struct sock *, struct tcp_info *); 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) ...@@ -998,7 +1000,9 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
#endif #endif
break; break;
default: default:
printk(timer_bug_msg); #ifdef TCP_DEBUG
printk(tcp_timer_bug_msg);
#endif
return; return;
}; };
...@@ -1033,7 +1037,9 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long ...@@ -1033,7 +1037,9 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
break; break;
default: default:
printk(timer_bug_msg); #ifdef TCP_DEBUG
printk(tcp_timer_bug_msg);
#endif
}; };
} }
......
...@@ -129,3 +129,35 @@ fc_type_trans(struct sk_buff *skb, struct net_device *dev) ...@@ -129,3 +129,35 @@ fc_type_trans(struct sk_buff *skb, struct net_device *dev)
return ntohs(ETH_P_802_2); 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);
...@@ -166,3 +166,44 @@ unsigned short fddi_type_trans(struct sk_buff *skb, struct net_device *dev) ...@@ -166,3 +166,44 @@ unsigned short fddi_type_trans(struct sk_buff *skb, struct net_device *dev)
} }
EXPORT_SYMBOL(fddi_type_trans); 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);
...@@ -154,3 +154,92 @@ unsigned short hippi_type_trans(struct sk_buff *skb, struct net_device *dev) ...@@ -154,3 +154,92 @@ unsigned short hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
} }
EXPORT_SYMBOL(hippi_type_trans); 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);
...@@ -583,6 +583,43 @@ static struct file_operations rif_seq_fops = { ...@@ -583,6 +583,43 @@ static struct file_operations rif_seq_fops = {
#endif #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 * Called during bootup. We don't actually have to initialise
* too much for this. * too much for this.
...@@ -604,3 +641,4 @@ module_init(rif_init); ...@@ -604,3 +641,4 @@ module_init(rif_init);
EXPORT_SYMBOL(tr_source_route); EXPORT_SYMBOL(tr_source_route);
EXPORT_SYMBOL(tr_type_trans); EXPORT_SYMBOL(tr_type_trans);
EXPORT_SYMBOL(alloc_trdev);
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
obj-$(CONFIG_ATALK) += appletalk.o 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_PROC_FS) += atalk_proc.o
appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o
...@@ -245,3 +245,64 @@ void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsign ...@@ -245,3 +245,64 @@ void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsign
} }
EXPORT_SYMBOL(eth_type_trans); 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);
...@@ -36,7 +36,9 @@ static void tcp_write_timer(unsigned long); ...@@ -36,7 +36,9 @@ static void tcp_write_timer(unsigned long);
static void tcp_delack_timer(unsigned long); static void tcp_delack_timer(unsigned long);
static void tcp_keepalive_timer (unsigned long data); 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 * Using different timers for retransmit, delayed acks and probes
...@@ -651,3 +653,6 @@ EXPORT_SYMBOL(tcp_clear_xmit_timers); ...@@ -651,3 +653,6 @@ EXPORT_SYMBOL(tcp_clear_xmit_timers);
EXPORT_SYMBOL(tcp_delete_keepalive_timer); EXPORT_SYMBOL(tcp_delete_keepalive_timer);
EXPORT_SYMBOL(tcp_init_xmit_timers); EXPORT_SYMBOL(tcp_init_xmit_timers);
EXPORT_SYMBOL(tcp_reset_keepalive_timer); EXPORT_SYMBOL(tcp_reset_keepalive_timer);
#ifdef TCP_DEBUG
EXPORT_SYMBOL(tcp_timer_bug_msg);
#endif
...@@ -921,7 +921,7 @@ int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev, int strict) ...@@ -921,7 +921,7 @@ int ipv6_chk_addr(struct in6_addr *addr, struct net_device *dev, int strict)
read_lock_bh(&addrconf_hash_lock); read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { 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)) { !(ifp->flags&IFA_F_TENTATIVE)) {
if (dev == NULL || ifp->idev->dev == dev || if (dev == NULL || ifp->idev->dev == dev ||
!(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) !(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) ...@@ -940,7 +940,7 @@ int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *dev)
read_lock_bh(&addrconf_hash_lock); read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { 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) if (dev == NULL || ifp->idev->dev == dev)
break; break;
} }
...@@ -956,7 +956,7 @@ struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device * ...@@ -956,7 +956,7 @@ struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, struct net_device *
read_lock_bh(&addrconf_hash_lock); read_lock_bh(&addrconf_hash_lock);
for(ifp = inet6_addr_lst[hash]; ifp; ifp=ifp->lst_next) { 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 || if (dev == NULL || ifp->idev->dev == dev ||
!(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) { !(ifp->scope&(IFA_LINK|IFA_HOST) || strict)) {
in6_ifa_hold(ifp); in6_ifa_hold(ifp);
...@@ -992,7 +992,7 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) ...@@ -992,7 +992,7 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
return 1; return 1;
if (sk2_rcv_saddr6 && if (sk2_rcv_saddr6 &&
!ipv6_addr_cmp(sk_rcv_saddr6, sk2_rcv_saddr6)) ipv6_addr_equal(sk_rcv_saddr6, sk2_rcv_saddr6))
return 1; return 1;
if (addr_type == IPV6_ADDR_MAPPED && if (addr_type == IPV6_ADDR_MAPPED &&
...@@ -1630,7 +1630,7 @@ static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen) ...@@ -1630,7 +1630,7 @@ static int inet6_addr_del(int ifindex, struct in6_addr *pfx, int plen)
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (ifp = idev->addr_list; ifp; ifp=ifp->if_next) { for (ifp = idev->addr_list; ifp; ifp=ifp->if_next) {
if (ifp->prefix_len == plen && if (ifp->prefix_len == plen &&
(!memcmp(pfx, &ifp->addr, sizeof(struct in6_addr)))) { ipv6_addr_equal(pfx, &ifp->addr)) {
in6_ifa_hold(ifp); in6_ifa_hold(ifp);
read_unlock_bh(&idev->lock); read_unlock_bh(&idev->lock);
......
...@@ -205,7 +205,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, struct in6_addr *addr) ...@@ -205,7 +205,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
prev_pac = NULL; prev_pac = NULL;
for (pac = np->ipv6_ac_list; pac; pac = pac->acl_next) { for (pac = np->ipv6_ac_list; pac; pac = pac->acl_next) {
if ((ifindex == 0 || pac->acl_ifindex == ifindex) && if ((ifindex == 0 || pac->acl_ifindex == ifindex) &&
ipv6_addr_cmp(&pac->acl_addr, addr) == 0) ipv6_addr_equal(&pac->acl_addr, addr))
break; break;
prev_pac = pac; prev_pac = pac;
} }
...@@ -278,7 +278,7 @@ int inet6_ac_check(struct sock *sk, struct in6_addr *addr, int ifindex) ...@@ -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) { for (pac=np->ipv6_ac_list; pac; pac=pac->acl_next) {
if (ifindex && pac->acl_ifindex != ifindex) if (ifindex && pac->acl_ifindex != ifindex)
continue; continue;
found = ipv6_addr_cmp(&pac->acl_addr, addr) == 0; found = ipv6_addr_equal(&pac->acl_addr, addr);
if (found) if (found)
break; break;
} }
...@@ -320,7 +320,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr) ...@@ -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) { 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++; aca->aca_users++;
err = 0; err = 0;
goto out; goto out;
...@@ -384,7 +384,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr) ...@@ -384,7 +384,7 @@ int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr)
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
prev_aca = NULL; prev_aca = NULL;
for (aca = idev->ac_list; aca; aca = aca->aca_next) { 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; break;
prev_aca = aca; prev_aca = aca;
} }
...@@ -436,7 +436,7 @@ static int ipv6_chk_acast_dev(struct net_device *dev, struct in6_addr *addr) ...@@ -436,7 +436,7 @@ static int ipv6_chk_acast_dev(struct net_device *dev, struct in6_addr *addr)
if (idev) { if (idev) {
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (aca = idev->ac_list; aca; aca = aca->aca_next) 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; break;
read_unlock_bh(&idev->lock); read_unlock_bh(&idev->lock);
in6_dev_put(idev); in6_dev_put(idev);
......
...@@ -190,7 +190,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -190,7 +190,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
} }
ip6_dst_store(sk, 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); &np->daddr : NULL);
sk->sk_state = TCP_ESTABLISHED; sk->sk_state = TCP_ESTABLISHED;
......
...@@ -451,8 +451,8 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, ...@@ -451,8 +451,8 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
if (iter->rt6i_dev == rt->rt6i_dev && if (iter->rt6i_dev == rt->rt6i_dev &&
iter->rt6i_idev == rt->rt6i_idev && iter->rt6i_idev == rt->rt6i_idev &&
ipv6_addr_cmp(&iter->rt6i_gateway, ipv6_addr_equal(&iter->rt6i_gateway,
&rt->rt6i_gateway) == 0) { &rt->rt6i_gateway)) {
if (!(iter->rt6i_flags&RTF_EXPIRES)) if (!(iter->rt6i_flags&RTF_EXPIRES))
return -EEXIST; return -EEXIST;
iter->rt6i_expires = rt->rt6i_expires; iter->rt6i_expires = rt->rt6i_expires;
......
...@@ -500,7 +500,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) ...@@ -500,7 +500,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
goto release; goto release;
err = -EINVAL; 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)) ipv6_opt_cmp(fl1->opt, fl->opt))
goto release; goto release;
......
...@@ -768,9 +768,9 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl) ...@@ -768,9 +768,9 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
*/ */
if (((rt->rt6i_dst.plen != 128 || 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 || && (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)) { || (fl->oif && fl->oif != (*dst)->dev->ifindex)) {
*dst = NULL; *dst = NULL;
} else } else
......
...@@ -133,8 +133,8 @@ ip6ip6_tnl_lookup(struct in6_addr *remote, struct in6_addr *local) ...@@ -133,8 +133,8 @@ ip6ip6_tnl_lookup(struct in6_addr *remote, struct in6_addr *local)
struct ip6_tnl *t; struct ip6_tnl *t;
for (t = tnls_r_l[h0 ^ h1]; t; t = t->next) { for (t = tnls_r_l[h0 ^ h1]; t; t = t->next) {
if (!ipv6_addr_cmp(local, &t->parms.laddr) && if (ipv6_addr_equal(local, &t->parms.laddr) &&
!ipv6_addr_cmp(remote, &t->parms.raddr) && ipv6_addr_equal(remote, &t->parms.raddr) &&
(t->dev->flags & IFF_UP)) (t->dev->flags & IFF_UP))
return t; return t;
} }
...@@ -284,8 +284,8 @@ ip6ip6_tnl_locate(struct ip6_tnl_parm *p, struct ip6_tnl **pt, int create) ...@@ -284,8 +284,8 @@ ip6ip6_tnl_locate(struct ip6_tnl_parm *p, struct ip6_tnl **pt, int create)
return -EINVAL; return -EINVAL;
for (t = *ip6ip6_bucket(p); t; t = t->next) { for (t = *ip6ip6_bucket(p); t; t = t->next) {
if (!ipv6_addr_cmp(local, &t->parms.laddr) && if (ipv6_addr_equal(local, &t->parms.laddr) &&
!ipv6_addr_cmp(remote, &t->parms.raddr)) { ipv6_addr_equal(remote, &t->parms.raddr)) {
*pt = t; *pt = t;
return (create ? -EEXIST : 0); return (create ? -EEXIST : 0);
} }
...@@ -602,7 +602,7 @@ static inline struct ipv6_txoptions *create_tel(__u8 encap_limit) ...@@ -602,7 +602,7 @@ static inline struct ipv6_txoptions *create_tel(__u8 encap_limit)
static inline int static inline int
ip6ip6_tnl_addr_conflict(struct ip6_tnl *t, struct ipv6hdr *hdr) 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);
} }
/** /**
......
...@@ -247,7 +247,7 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr) ...@@ -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); write_lock_bh(&ipv6_sk_mc_lock);
for (lnk = &np->ipv6_mc_list; (mc_lst = *lnk) !=NULL ; lnk = &mc_lst->next) { for (lnk = &np->ipv6_mc_list; (mc_lst = *lnk) !=NULL ; lnk = &mc_lst->next) {
if ((ifindex == 0 || mc_lst->ifindex == ifindex) && 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; struct net_device *dev;
*lnk = mc_lst->next; *lnk = mc_lst->next;
...@@ -369,7 +369,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk, ...@@ -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) { for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface) if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface)
continue; continue;
if (ipv6_addr_cmp(&pmc->addr, group) == 0) if (ipv6_addr_equal(&pmc->addr, group))
break; break;
} }
if (!pmc) /* must have a prior join */ if (!pmc) /* must have a prior join */
...@@ -485,7 +485,7 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf) ...@@ -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) { for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pmc->ifindex != gsf->gf_interface) if (pmc->ifindex != gsf->gf_interface)
continue; continue;
if (ipv6_addr_cmp(&pmc->addr, group) == 0) if (ipv6_addr_equal(&pmc->addr, group))
break; break;
} }
if (!pmc) /* must have a prior join */ if (!pmc) /* must have a prior join */
...@@ -556,7 +556,7 @@ int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf, ...@@ -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) { for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
if (pmc->ifindex != gsf->gf_interface) if (pmc->ifindex != gsf->gf_interface)
continue; continue;
if (ipv6_addr_cmp(group, &pmc->addr) == 0) if (ipv6_addr_equal(group, &pmc->addr))
break; break;
} }
if (!pmc) /* must have a prior join */ if (!pmc) /* must have a prior join */
...@@ -603,7 +603,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, ...@@ -603,7 +603,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
read_lock(&ipv6_sk_mc_lock); read_lock(&ipv6_sk_mc_lock);
for (mc = np->ipv6_mc_list; mc; mc = mc->next) { 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; break;
} }
if (!mc) { if (!mc) {
...@@ -617,7 +617,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr, ...@@ -617,7 +617,7 @@ int inet6_mc_check(struct sock *sk, struct in6_addr *mc_addr,
int i; int i;
for (i=0; i<psl->sl_count; 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; break;
} }
if (mc->sfmode == MCAST_INCLUDE && i >= psl->sl_count) 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) ...@@ -740,7 +740,7 @@ static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca)
write_lock_bh(&idev->mc_lock); write_lock_bh(&idev->mc_lock);
pmc_prev = NULL; pmc_prev = NULL;
for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { 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; break;
pmc_prev = pmc; pmc_prev = pmc;
} }
...@@ -816,7 +816,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr) ...@@ -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) { 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++; mc->mca_users++;
write_unlock_bh(&idev->lock); write_unlock_bh(&idev->lock);
ip6_mc_add_src(idev, &mc->mca_addr, MCAST_EXCLUDE, 0, 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) ...@@ -878,7 +878,7 @@ int __ipv6_dev_mc_dec(struct inet6_dev *idev, struct in6_addr *addr)
write_lock_bh(&idev->lock); write_lock_bh(&idev->lock);
for (map = &idev->mc_list; (ma=*map) != NULL; map = &ma->next) { 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) { if (--ma->mca_users == 0) {
*map = ma->next; *map = ma->next;
write_unlock_bh(&idev->lock); write_unlock_bh(&idev->lock);
...@@ -953,7 +953,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, ...@@ -953,7 +953,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
if (idev) { if (idev) {
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (mc = idev->mc_list; mc; mc=mc->next) { 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; break;
} }
if (mc) { if (mc) {
...@@ -962,8 +962,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group, ...@@ -962,8 +962,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
spin_lock_bh(&mc->mca_lock); spin_lock_bh(&mc->mca_lock);
for (psf=mc->mca_sources;psf;psf=psf->sf_next) { for (psf=mc->mca_sources;psf;psf=psf->sf_next) {
if (ipv6_addr_cmp(&psf->sf_addr, if (ipv6_addr_equal(&psf->sf_addr, src_addr))
src_addr) == 0)
break; break;
} }
if (psf) if (psf)
...@@ -1040,7 +1039,7 @@ static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, ...@@ -1040,7 +1039,7 @@ static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
if (scount == nsrcs) if (scount == nsrcs)
break; break;
for (i=0; i<nsrcs; i++) 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; psf->sf_gsresp = 1;
scount++; scount++;
break; break;
...@@ -1135,7 +1134,7 @@ int igmp6_event_query(struct sk_buff *skb) ...@@ -1135,7 +1134,7 @@ int igmp6_event_query(struct sk_buff *skb)
} else { } else {
for (ma = idev->mc_list; ma; ma=ma->next) { for (ma = idev->mc_list; ma; ma=ma->next) {
if (group_type != IPV6_ADDR_ANY && if (group_type != IPV6_ADDR_ANY &&
ipv6_addr_cmp(group, &ma->mca_addr) != 0) !ipv6_addr_equal(group, &ma->mca_addr))
continue; continue;
spin_lock_bh(&ma->mca_lock); spin_lock_bh(&ma->mca_lock);
if (ma->mca_flags & MAF_TIMER_RUNNING) { if (ma->mca_flags & MAF_TIMER_RUNNING) {
...@@ -1200,7 +1199,7 @@ int igmp6_event_report(struct sk_buff *skb) ...@@ -1200,7 +1199,7 @@ int igmp6_event_report(struct sk_buff *skb)
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (ma = idev->mc_list; ma; ma=ma->next) { 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); spin_lock(&ma->mca_lock);
if (del_timer(&ma->mca_timer)) if (del_timer(&ma->mca_timer))
atomic_dec(&ma->mca_refcnt); atomic_dec(&ma->mca_refcnt);
...@@ -1695,7 +1694,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode, ...@@ -1695,7 +1694,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
psf_prev = NULL; psf_prev = NULL;
for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 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; break;
psf_prev = psf; psf_prev = psf;
} }
...@@ -1735,7 +1734,7 @@ int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, ...@@ -1735,7 +1734,7 @@ int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode,
return -ENODEV; return -ENODEV;
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 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; break;
} }
if (!pmc) { if (!pmc) {
...@@ -1790,7 +1789,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, ...@@ -1790,7 +1789,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
psf_prev = NULL; psf_prev = NULL;
for (psf=pmc->mca_sources; psf; psf=psf->sf_next) { 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; break;
psf_prev = psf; psf_prev = psf;
} }
...@@ -1859,7 +1858,7 @@ int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, ...@@ -1859,7 +1858,7 @@ int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode,
return -ENODEV; return -ENODEV;
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
for (pmc=idev->mc_list; pmc; pmc=pmc->next) { 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; break;
} }
if (!pmc) { if (!pmc) {
......
...@@ -1219,7 +1219,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) ...@@ -1219,7 +1219,7 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
return; return;
} }
if (ipv6_addr_cmp(dest, target) == 0) { if (ipv6_addr_equal(dest, target)) {
on_link = 1; on_link = 1;
} else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { } else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) {
ND_PRINTK2(KERN_WARNING ND_PRINTK2(KERN_WARNING
......
...@@ -376,8 +376,8 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e) ...@@ -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) { if (e->info->hook == NF_IP_LOCAL_OUT) {
struct ipv6hdr *iph = e->skb->nh.ipv6h; struct ipv6hdr *iph = e->skb->nh.ipv6h;
if (ipv6_addr_cmp(&iph->daddr, &e->rt_info.daddr) || if (!ipv6_addr_equal(&iph->daddr, &e->rt_info.daddr) ||
ipv6_addr_cmp(&iph->saddr, &e->rt_info.saddr)) !ipv6_addr_equal(&iph->saddr, &e->rt_info.saddr))
return ip6_route_me_harder(e->skb); return ip6_route_me_harder(e->skb);
} }
return 0; return 0;
......
...@@ -209,7 +209,7 @@ match(const struct sk_buff *skb, ...@@ -209,7 +209,7 @@ match(const struct sk_buff *skb,
BUG_ON(ap == NULL); 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); DEBUGP("i=%d temp=%d;\n",i,temp);
i++; i++;
} }
...@@ -236,7 +236,7 @@ match(const struct sk_buff *skb, ...@@ -236,7 +236,7 @@ match(const struct sk_buff *skb,
&_addr); &_addr);
BUG_ON(ap == NULL); BUG_ON(ap == NULL);
if (ipv6_addr_cmp(ap, &rtinfo->addrs[temp])) if (!ipv6_addr_equal(ap, &rtinfo->addrs[temp]))
break; break;
} }
DEBUGP("temp=%d #%d\n", temp, rtinfo->addrnr); DEBUGP("temp=%d #%d\n", temp, rtinfo->addrnr);
......
...@@ -90,11 +90,11 @@ struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num, ...@@ -90,11 +90,11 @@ struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
if (!ipv6_addr_any(&np->daddr) && if (!ipv6_addr_any(&np->daddr) &&
ipv6_addr_cmp(&np->daddr, rmt_addr)) !ipv6_addr_equal(&np->daddr, rmt_addr))
continue; continue;
if (!ipv6_addr_any(&np->rcv_saddr)) { 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; goto found;
if (is_multicast && if (is_multicast &&
inet6_mc_check(sk, loc_addr, rmt_addr)) inet6_mc_check(sk, loc_addr, rmt_addr))
...@@ -668,7 +668,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -668,7 +668,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
* sk->sk_dst_cache. * sk->sk_dst_cache.
*/ */
if (sk->sk_state == TCP_ESTABLISHED && if (sk->sk_state == TCP_ESTABLISHED &&
!ipv6_addr_cmp(daddr, &np->daddr)) ipv6_addr_equal(daddr, &np->daddr))
daddr = &np->daddr; daddr = &np->daddr;
if (addr_len >= sizeof(struct sockaddr_in6) && if (addr_len >= sizeof(struct sockaddr_in6) &&
...@@ -775,7 +775,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -775,7 +775,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
} }
done: done:
ip6_dst_store(sk, 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); &np->daddr : NULL);
if (err > 0) if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0; err = np->recverr ? net_xmit_errno(err) : 0;
......
...@@ -342,8 +342,8 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash, ...@@ -342,8 +342,8 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash,
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
for (fq = ip6_frag_hash[hash]; fq; fq = fq->next) { for (fq = ip6_frag_hash[hash]; fq; fq = fq->next) {
if (fq->id == fq_in->id && if (fq->id == fq_in->id &&
!ipv6_addr_cmp(&fq_in->saddr, &fq->saddr) && ipv6_addr_equal(&fq_in->saddr, &fq->saddr) &&
!ipv6_addr_cmp(&fq_in->daddr, &fq->daddr)) { ipv6_addr_equal(&fq_in->daddr, &fq->daddr)) {
atomic_inc(&fq->refcnt); atomic_inc(&fq->refcnt);
write_unlock(&ip6_frag_lock); write_unlock(&ip6_frag_lock);
fq_in->last_in |= COMPLETE; fq_in->last_in |= COMPLETE;
...@@ -406,8 +406,8 @@ fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst) ...@@ -406,8 +406,8 @@ fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst)
read_lock(&ip6_frag_lock); read_lock(&ip6_frag_lock);
for(fq = ip6_frag_hash[hash]; fq; fq = fq->next) { for(fq = ip6_frag_hash[hash]; fq; fq = fq->next) {
if (fq->id == id && if (fq->id == id &&
!ipv6_addr_cmp(src, &fq->saddr) && ipv6_addr_equal(src, &fq->saddr) &&
!ipv6_addr_cmp(dst, &fq->daddr)) { ipv6_addr_equal(dst, &fq->daddr)) {
atomic_inc(&fq->refcnt); atomic_inc(&fq->refcnt);
read_unlock(&ip6_frag_lock); read_unlock(&ip6_frag_lock);
return fq; return fq;
......
...@@ -1006,7 +1006,7 @@ static int ip6_route_del(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_r ...@@ -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)) rt->rt6i_dev->ifindex != rtmsg->rtmsg_ifindex))
continue; continue;
if (rtmsg->rtmsg_flags&RTF_GATEWAY && 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; continue;
if (rtmsg->rtmsg_metric && if (rtmsg->rtmsg_metric &&
rtmsg->rtmsg_metric != rt->rt6i_metric) rtmsg->rtmsg_metric != rt->rt6i_metric)
...@@ -1057,13 +1057,13 @@ void rt6_redirect(struct in6_addr *dest, struct in6_addr *saddr, ...@@ -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 * is a bit fuzzy and one might need to check all default
* routers. * routers.
*/ */
if (ipv6_addr_cmp(saddr, &rt->rt6i_gateway)) { if (!ipv6_addr_equal(saddr, &rt->rt6i_gateway)) {
if (rt->rt6i_flags & RTF_DEFAULT) { if (rt->rt6i_flags & RTF_DEFAULT) {
struct rt6_info *rt1; struct rt6_info *rt1;
read_lock(&rt6_lock); read_lock(&rt6_lock);
for (rt1 = ip6_routing_table.leaf; rt1; rt1 = rt1->u.next) { 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_hold(&rt1->u.dst);
dst_release(&rt->u.dst); dst_release(&rt->u.dst);
read_unlock(&rt6_lock); read_unlock(&rt6_lock);
...@@ -1262,7 +1262,7 @@ struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *d ...@@ -1262,7 +1262,7 @@ struct rt6_info *rt6_get_dflt_router(struct in6_addr *addr, struct net_device *d
write_lock_bh(&rt6_lock); write_lock_bh(&rt6_lock);
for (rt = fn->leaf; rt; rt=rt->u.next) { for (rt = fn->leaf; rt; rt=rt->u.next) {
if (dev == rt->rt6i_dev && if (dev == rt->rt6i_dev &&
ipv6_addr_cmp(&rt->rt6i_gateway, addr) == 0) ipv6_addr_equal(&rt->rt6i_gateway, addr))
break; break;
} }
if (rt) if (rt)
......
...@@ -262,7 +262,7 @@ static struct sock *tcp_v6_lookup_listener(struct in6_addr *daddr, unsigned shor ...@@ -262,7 +262,7 @@ static struct sock *tcp_v6_lookup_listener(struct in6_addr *daddr, unsigned shor
score = 1; score = 1;
if (!ipv6_addr_any(&np->rcv_saddr)) { if (!ipv6_addr_any(&np->rcv_saddr)) {
if (ipv6_addr_cmp(&np->rcv_saddr, daddr)) if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
continue; continue;
score++; score++;
} }
...@@ -321,8 +321,8 @@ static inline struct sock *__tcp_v6_lookup_established(struct in6_addr *saddr, u ...@@ -321,8 +321,8 @@ static inline struct sock *__tcp_v6_lookup_established(struct in6_addr *saddr, u
if(*((__u32 *)&(tw->tw_dport)) == ports && if(*((__u32 *)&(tw->tw_dport)) == ports &&
sk->sk_family == PF_INET6) { sk->sk_family == PF_INET6) {
if(!ipv6_addr_cmp(&tw->tw_v6_daddr, saddr) && if(ipv6_addr_equal(&tw->tw_v6_daddr, saddr) &&
!ipv6_addr_cmp(&tw->tw_v6_rcv_saddr, daddr) && ipv6_addr_equal(&tw->tw_v6_rcv_saddr, daddr) &&
(!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif)) (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == dif))
goto hit; goto hit;
} }
...@@ -406,8 +406,8 @@ static struct open_request *tcp_v6_search_req(struct tcp_opt *tp, ...@@ -406,8 +406,8 @@ static struct open_request *tcp_v6_search_req(struct tcp_opt *tp,
prev = &req->dl_next) { prev = &req->dl_next) {
if (req->rmt_port == rport && if (req->rmt_port == rport &&
req->class->family == AF_INET6 && req->class->family == AF_INET6 &&
!ipv6_addr_cmp(&req->af.v6_req.rmt_addr, raddr) && ipv6_addr_equal(&req->af.v6_req.rmt_addr, raddr) &&
!ipv6_addr_cmp(&req->af.v6_req.loc_addr, laddr) && ipv6_addr_equal(&req->af.v6_req.loc_addr, laddr) &&
(!req->af.v6_req.iif || req->af.v6_req.iif == iif)) { (!req->af.v6_req.iif || req->af.v6_req.iif == iif)) {
BUG_TRAP(req->sk == NULL); BUG_TRAP(req->sk == NULL);
*prevp = prev; *prevp = prev;
...@@ -463,8 +463,8 @@ static int tcp_v6_check_established(struct sock *sk) ...@@ -463,8 +463,8 @@ static int tcp_v6_check_established(struct sock *sk)
if(*((__u32 *)&(tw->tw_dport)) == ports && if(*((__u32 *)&(tw->tw_dport)) == ports &&
sk2->sk_family == PF_INET6 && sk2->sk_family == PF_INET6 &&
!ipv6_addr_cmp(&tw->tw_v6_daddr, saddr) && ipv6_addr_equal(&tw->tw_v6_daddr, saddr) &&
!ipv6_addr_cmp(&tw->tw_v6_rcv_saddr, daddr) && ipv6_addr_equal(&tw->tw_v6_rcv_saddr, daddr) &&
sk2->sk_bound_dev_if == sk->sk_bound_dev_if) { sk2->sk_bound_dev_if == sk->sk_bound_dev_if) {
struct tcp_opt *tp = tcp_sk(sk); struct tcp_opt *tp = tcp_sk(sk);
...@@ -610,7 +610,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, ...@@ -610,7 +610,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
} }
if (tp->ts_recent_stamp && 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 = 0;
tp->ts_recent_stamp = 0; tp->ts_recent_stamp = 0;
tp->write_seq = 0; tp->write_seq = 0;
......
...@@ -171,12 +171,12 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport, ...@@ -171,12 +171,12 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport,
score++; score++;
} }
if (!ipv6_addr_any(&np->rcv_saddr)) { if (!ipv6_addr_any(&np->rcv_saddr)) {
if (ipv6_addr_cmp(&np->rcv_saddr, daddr)) if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
continue; continue;
score++; score++;
} }
if (!ipv6_addr_any(&np->daddr)) { if (!ipv6_addr_any(&np->daddr)) {
if (ipv6_addr_cmp(&np->daddr, saddr)) if (!ipv6_addr_equal(&np->daddr, saddr))
continue; continue;
score++; score++;
} }
...@@ -395,14 +395,14 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, ...@@ -395,14 +395,14 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
continue; continue;
} }
if (!ipv6_addr_any(&np->daddr) && if (!ipv6_addr_any(&np->daddr) &&
ipv6_addr_cmp(&np->daddr, rmt_addr)) !ipv6_addr_equal(&np->daddr, rmt_addr))
continue; continue;
if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif) if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
continue; continue;
if (!ipv6_addr_any(&np->rcv_saddr)) { 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; return s;
continue; continue;
} }
...@@ -732,7 +732,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -732,7 +732,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
* sk->sk_dst_cache. * sk->sk_dst_cache.
*/ */
if (sk->sk_state == TCP_ESTABLISHED && if (sk->sk_state == TCP_ESTABLISHED &&
!ipv6_addr_cmp(daddr, &np->daddr)) ipv6_addr_equal(daddr, &np->daddr))
daddr = &np->daddr; daddr = &np->daddr;
if (addr_len >= sizeof(struct sockaddr_in6) && if (addr_len >= sizeof(struct sockaddr_in6) &&
...@@ -840,7 +840,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk, ...@@ -840,7 +840,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if (dst) if (dst)
ip6_dst_store(sk, 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); &np->daddr : NULL);
if (err > 0) if (err > 0)
err = np->recverr ? net_xmit_errno(err) : 0; err = np->recverr ? net_xmit_errno(err) : 0;
......
...@@ -68,8 +68,8 @@ __xfrm6_find_bundle(struct flowi *fl, struct xfrm_policy *policy) ...@@ -68,8 +68,8 @@ __xfrm6_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
ipv6_addr_prefix(&fl_src_prefix, ipv6_addr_prefix(&fl_src_prefix,
&fl->fl6_src, &fl->fl6_src,
xdst->u.rt6.rt6i_src.plen); xdst->u.rt6.rt6i_src.plen);
if (!ipv6_addr_cmp(&xdst->u.rt6.rt6i_dst.addr, &fl_dst_prefix) && if (ipv6_addr_equal(&xdst->u.rt6.rt6i_dst.addr, &fl_dst_prefix) &&
!ipv6_addr_cmp(&xdst->u.rt6.rt6i_src.addr, &fl_src_prefix) && ipv6_addr_equal(&xdst->u.rt6.rt6i_src.addr, &fl_src_prefix) &&
__xfrm6_bundle_ok(xdst, fl)) { __xfrm6_bundle_ok(xdst, fl)) {
dst_clone(dst); dst_clone(dst);
break; break;
...@@ -123,7 +123,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -123,7 +123,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
trailer_len += xfrm[i]->props.trailer_len; 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; struct flowi fl_tunnel;
memset(&fl_tunnel, 0, sizeof(fl_tunnel)); memset(&fl_tunnel, 0, sizeof(fl_tunnel));
......
...@@ -55,7 +55,7 @@ __xfrm6_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto) ...@@ -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) { list_for_each_entry(x, xfrm6_state_afinfo.state_byspi+h, byspi) {
if (x->props.family == AF_INET6 && if (x->props.family == AF_INET6 &&
spi == x->id.spi && 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) { proto == x->id.proto) {
xfrm_state_hold(x); xfrm_state_hold(x);
return x; return x;
...@@ -76,10 +76,10 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto, ...@@ -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) { list_for_each_entry(x, xfrm6_state_afinfo.state_bydst+h, bydst) {
if (x->props.family == AF_INET6 && 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 && mode == x->props.mode &&
proto == x->id.proto && 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 && reqid == x->props.reqid &&
x->km.state == XFRM_STATE_ACQ && x->km.state == XFRM_STATE_ACQ &&
!x->id.spi) { !x->id.spi) {
......
...@@ -461,7 +461,7 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1, ...@@ -461,7 +461,7 @@ static int sctp_v6_cmp_addr(const union sctp_addr *addr1,
} }
return 0; 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; return 0;
/* If this is a linklocal address, compare the scope_id. */ /* If this is a linklocal address, compare the scope_id. */
if (ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) { if (ipv6_addr_type(&addr1->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment