aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_route.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:49:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-28 15:49:40 -0500
commit0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (patch)
tree454d1842b1833d976da62abcbd5c47521ebe9bd7 /net/decnet/dn_route.c
parent54a696bd07c14d3b1192d03ce7269bc59b45209a (diff)
parenteb56092fc168bf5af199d47af50c0d84a96db898 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits) net: Allow dependancies of FDDI & Tokenring to be modular. igb: Fix build warning when DCA is disabled. net: Fix warning fallout from recent NAPI interface changes. gro: Fix potential use after free sfc: If AN is enabled, always read speed/duplex from the AN advertising bits sfc: When disabling the NIC, close the device rather than unregistering it sfc: SFT9001: Add cable diagnostics sfc: Add support for multiple PHY self-tests sfc: Merge top-level functions for self-tests sfc: Clean up PHY mode management in loopback self-test sfc: Fix unreliable link detection in some loopback modes sfc: Generate unique names for per-NIC workqueues 802.3ad: use standard ethhdr instead of ad_header 802.3ad: generalize out mac address initializer 802.3ad: initialize ports LACPDU from const initializer 802.3ad: remove typedef around ad_system 802.3ad: turn ports is_individual into a bool 802.3ad: turn ports is_enabled into a bool 802.3ad: make ntt bool ixgbe: Fix set_ringparam in ixgbe to use the same memory pools. ... Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due to the conversion to %pI (in this networking merge) and the addition of doing IPv6 addresses (from the earlier merge of CIFS).
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r--net/decnet/dn_route.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 821bd1cdec04..c754670b7fca 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -131,7 +131,6 @@ static struct dst_ops dn_dst_ops = {
131 .negative_advice = dn_dst_negative_advice, 131 .negative_advice = dn_dst_negative_advice,
132 .link_failure = dn_dst_link_failure, 132 .link_failure = dn_dst_link_failure,
133 .update_pmtu = dn_dst_update_pmtu, 133 .update_pmtu = dn_dst_update_pmtu,
134 .entry_size = sizeof(struct dn_route),
135 .entries = ATOMIC_INIT(0), 134 .entries = ATOMIC_INIT(0),
136}; 135};
137 136
@@ -312,7 +311,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route *
312 return 0; 311 return 0;
313} 312}
314 313
315void dn_run_flush(unsigned long dummy) 314static void dn_run_flush(unsigned long dummy)
316{ 315{
317 int i; 316 int i;
318 struct dn_route *rt, *next; 317 struct dn_route *rt, *next;
@@ -476,7 +475,7 @@ static int dn_route_rx_packet(struct sk_buff *skb)
476 printk(KERN_DEBUG 475 printk(KERN_DEBUG
477 "DECnet: dn_route_rx_packet: rt_flags=0x%02x dev=%s len=%d src=0x%04hx dst=0x%04hx err=%d type=%d\n", 476 "DECnet: dn_route_rx_packet: rt_flags=0x%02x dev=%s len=%d src=0x%04hx dst=0x%04hx err=%d type=%d\n",
478 (int)cb->rt_flags, devname, skb->len, 477 (int)cb->rt_flags, devname, skb->len,
479 dn_ntohs(cb->src), dn_ntohs(cb->dst), 478 le16_to_cpu(cb->src), le16_to_cpu(cb->dst),
480 err, skb->pkt_type); 479 err, skb->pkt_type);
481 } 480 }
482 481
@@ -576,7 +575,7 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
576{ 575{
577 struct dn_skb_cb *cb; 576 struct dn_skb_cb *cb;
578 unsigned char flags = 0; 577 unsigned char flags = 0;
579 __u16 len = dn_ntohs(*(__le16 *)skb->data); 578 __u16 len = le16_to_cpu(*(__le16 *)skb->data);
580 struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr; 579 struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr;
581 unsigned char padlen = 0; 580 unsigned char padlen = 0;
582 581
@@ -774,7 +773,7 @@ static int dn_rt_bug(struct sk_buff *skb)
774 struct dn_skb_cb *cb = DN_SKB_CB(skb); 773 struct dn_skb_cb *cb = DN_SKB_CB(skb);
775 774
776 printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n", 775 printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n",
777 dn_ntohs(cb->src), dn_ntohs(cb->dst)); 776 le16_to_cpu(cb->src), le16_to_cpu(cb->dst));
778 } 777 }
779 778
780 kfree_skb(skb); 779 kfree_skb(skb);
@@ -817,7 +816,7 @@ static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
817 816
818static inline int dn_match_addr(__le16 addr1, __le16 addr2) 817static inline int dn_match_addr(__le16 addr1, __le16 addr2)
819{ 818{
820 __u16 tmp = dn_ntohs(addr1) ^ dn_ntohs(addr2); 819 __u16 tmp = le16_to_cpu(addr1) ^ le16_to_cpu(addr2);
821 int match = 16; 820 int match = 16;
822 while(tmp) { 821 while(tmp) {
823 tmp >>= 1; 822 tmp >>= 1;
@@ -887,8 +886,8 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
887 if (decnet_debug_level & 16) 886 if (decnet_debug_level & 16)
888 printk(KERN_DEBUG 887 printk(KERN_DEBUG
889 "dn_route_output_slow: dst=%04x src=%04x mark=%d" 888 "dn_route_output_slow: dst=%04x src=%04x mark=%d"
890 " iif=%d oif=%d\n", dn_ntohs(oldflp->fld_dst), 889 " iif=%d oif=%d\n", le16_to_cpu(oldflp->fld_dst),
891 dn_ntohs(oldflp->fld_src), 890 le16_to_cpu(oldflp->fld_src),
892 oldflp->mark, init_net.loopback_dev->ifindex, oldflp->oif); 891 oldflp->mark, init_net.loopback_dev->ifindex, oldflp->oif);
893 892
894 /* If we have an output interface, verify its a DECnet device */ 893 /* If we have an output interface, verify its a DECnet device */
@@ -960,7 +959,7 @@ source_ok:
960 printk(KERN_DEBUG 959 printk(KERN_DEBUG
961 "dn_route_output_slow: initial checks complete." 960 "dn_route_output_slow: initial checks complete."
962 " dst=%o4x src=%04x oif=%d try_hard=%d\n", 961 " dst=%o4x src=%04x oif=%d try_hard=%d\n",
963 dn_ntohs(fl.fld_dst), dn_ntohs(fl.fld_src), 962 le16_to_cpu(fl.fld_dst), le16_to_cpu(fl.fld_src),
964 fl.oif, try_hard); 963 fl.oif, try_hard);
965 964
966 /* 965 /*
@@ -1185,7 +1184,7 @@ static int dn_route_output_key(struct dst_entry **pprt, struct flowi *flp, int f
1185 1184
1186 err = __dn_route_output_key(pprt, flp, flags); 1185 err = __dn_route_output_key(pprt, flp, flags);
1187 if (err == 0 && flp->proto) { 1186 if (err == 0 && flp->proto) {
1188 err = xfrm_lookup(pprt, flp, NULL, 0); 1187 err = xfrm_lookup(&init_net, pprt, flp, NULL, 0);
1189 } 1188 }
1190 return err; 1189 return err;
1191} 1190}
@@ -1196,8 +1195,8 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
1196 1195
1197 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); 1196 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
1198 if (err == 0 && fl->proto) { 1197 if (err == 0 && fl->proto) {
1199 err = xfrm_lookup(pprt, fl, sk, (flags & MSG_DONTWAIT) ? 1198 err = xfrm_lookup(&init_net, pprt, fl, sk,
1200 0 : XFRM_LOOKUP_WAIT); 1199 (flags & MSG_DONTWAIT) ? 0 : XFRM_LOOKUP_WAIT);
1201 } 1200 }
1202 return err; 1201 return err;
1203} 1202}
@@ -1423,7 +1422,7 @@ e_neighbour:
1423 goto done; 1422 goto done;
1424} 1423}
1425 1424
1426int dn_route_input(struct sk_buff *skb) 1425static int dn_route_input(struct sk_buff *skb)
1427{ 1426{
1428 struct dn_route *rt; 1427 struct dn_route *rt;
1429 struct dn_skb_cb *cb = DN_SKB_CB(skb); 1428 struct dn_skb_cb *cb = DN_SKB_CB(skb);
@@ -1712,8 +1711,8 @@ static int dn_rt_cache_seq_show(struct seq_file *seq, void *v)
1712 1711
1713 seq_printf(seq, "%-8s %-7s %-7s %04d %04d %04d\n", 1712 seq_printf(seq, "%-8s %-7s %-7s %04d %04d %04d\n",
1714 rt->u.dst.dev ? rt->u.dst.dev->name : "*", 1713 rt->u.dst.dev ? rt->u.dst.dev->name : "*",
1715 dn_addr2asc(dn_ntohs(rt->rt_daddr), buf1), 1714 dn_addr2asc(le16_to_cpu(rt->rt_daddr), buf1),
1716 dn_addr2asc(dn_ntohs(rt->rt_saddr), buf2), 1715 dn_addr2asc(le16_to_cpu(rt->rt_saddr), buf2),
1717 atomic_read(&rt->u.dst.__refcnt), 1716 atomic_read(&rt->u.dst.__refcnt),
1718 rt->u.dst.__use, 1717 rt->u.dst.__use,
1719 (int) dst_metric(&rt->u.dst, RTAX_RTT)); 1718 (int) dst_metric(&rt->u.dst, RTAX_RTT));