git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
net
/
decnet
/
dn_route.c
diff --git
a/net/decnet/dn_route.c
b/net/decnet/dn_route.c
index
309a8b3
..
e172cf9
100644
(file)
--- a/
net/decnet/dn_route.c
+++ b/
net/decnet/dn_route.c
@@
-117,8
+117,7
@@
static struct dn_rt_hash_bucket *dn_rt_hash_table;
static unsigned dn_rt_hash_mask;
static struct timer_list dn_route_timer;
static unsigned dn_rt_hash_mask;
static struct timer_list dn_route_timer;
-static struct timer_list dn_rt_flush_timer =
- TIMER_INITIALIZER(dn_run_flush, 0, 0);
+static DEFINE_TIMER(dn_rt_flush_timer, dn_run_flush, 0, 0);
int decnet_dst_gc_interval = 2;
static struct dst_ops dn_dst_ops = {
int decnet_dst_gc_interval = 2;
static struct dst_ops dn_dst_ops = {
@@
-134,9
+133,9
@@
static struct dst_ops dn_dst_ops = {
.entries = ATOMIC_INIT(0),
};
.entries = ATOMIC_INIT(0),
};
-static __inline__ unsigned dn_hash(
unsigned short src, unsigned short
dst)
+static __inline__ unsigned dn_hash(
__le16 src, __le16
dst)
{
{
-
unsigned short tmp = src ^ dst
;
+
__u16 tmp = (__u16 __force)(src ^ dst)
;
tmp ^= (tmp >> 3);
tmp ^= (tmp >> 5);
tmp ^= (tmp >> 10);
tmp ^= (tmp >> 3);
tmp ^= (tmp >> 5);
tmp ^= (tmp >> 10);
@@
-150,8
+149,7
@@
static inline void dnrt_free(struct dn_route *rt)
static inline void dnrt_drop(struct dn_route *rt)
{
static inline void dnrt_drop(struct dn_route *rt)
{
- if (rt)
- dst_release(&rt->u.dst);
+ dst_release(&rt->u.dst);
call_rcu_bh(&rt->u.dst.rcu_head, dst_rcu_free);
}
call_rcu_bh(&rt->u.dst.rcu_head, dst_rcu_free);
}
@@
-253,7
+251,6
@@
static void dn_dst_update_pmtu(struct dst_entry *dst, u32 mtu)
*/
static struct dst_entry *dn_dst_check(struct dst_entry *dst, __u32 cookie)
{
*/
static struct dst_entry *dn_dst_check(struct dst_entry *dst, __u32 cookie)
{
- dst_release(dst);
return NULL;
}
return NULL;
}
@@
-381,9
+378,9
@@
static int dn_return_short(struct sk_buff *skb)
{
struct dn_skb_cb *cb;
unsigned char *ptr;
{
struct dn_skb_cb *cb;
unsigned char *ptr;
-
dn_address
*src;
-
dn_address
*dst;
-
dn_address
tmp;
+
__le16
*src;
+
__le16
*dst;
+
__le16
tmp;
/* Add back headers */
skb_push(skb, skb->data - skb->nh.raw);
/* Add back headers */
skb_push(skb, skb->data - skb->nh.raw);
@@
-396,9
+393,9
@@
static int dn_return_short(struct sk_buff *skb)
ptr = skb->data + 2;
*ptr++ = (cb->rt_flags & ~DN_RT_F_RQR) | DN_RT_F_RTS;
ptr = skb->data + 2;
*ptr++ = (cb->rt_flags & ~DN_RT_F_RQR) | DN_RT_F_RTS;
- dst = (
dn_address
*)ptr;
+ dst = (
__le16
*)ptr;
ptr += 2;
ptr += 2;
- src = (
dn_address
*)ptr;
+ src = (
__le16
*)ptr;
ptr += 2;
*ptr = 0; /* Zero hop count */
ptr += 2;
*ptr = 0; /* Zero hop count */
@@
-477,7
+474,8
@@
static int dn_route_rx_packet(struct sk_buff *skb)
struct dn_skb_cb *cb = DN_SKB_CB(skb);
printk(KERN_DEBUG
"DECnet: dn_route_rx_packet: rt_flags=0x%02x dev=%s len=%d src=0x%04hx dst=0x%04hx err=%d type=%d\n",
struct dn_skb_cb *cb = DN_SKB_CB(skb);
printk(KERN_DEBUG
"DECnet: dn_route_rx_packet: rt_flags=0x%02x dev=%s len=%d src=0x%04hx dst=0x%04hx err=%d type=%d\n",
- (int)cb->rt_flags, devname, skb->len, cb->src, cb->dst,
+ (int)cb->rt_flags, devname, skb->len,
+ dn_ntohs(cb->src), dn_ntohs(cb->dst),
err, skb->pkt_type);
}
err, skb->pkt_type);
}
@@
-507,7
+505,7
@@
static int dn_route_rx_long(struct sk_buff *skb)
/* Destination info */
ptr += 2;
/* Destination info */
ptr += 2;
- cb->dst = dn_
htons(dn_eth2dn(ptr)
);
+ cb->dst = dn_
eth2dn(ptr
);
if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it;
ptr += 6;
if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it;
ptr += 6;
@@
-515,7
+513,7
@@
static int dn_route_rx_long(struct sk_buff *skb)
/* Source info */
ptr += 2;
/* Source info */
ptr += 2;
- cb->src = dn_
htons(dn_eth2dn(ptr)
);
+ cb->src = dn_
eth2dn(ptr
);
if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it;
ptr += 6;
if (memcmp(ptr, dn_hiord_addr, 4) != 0)
goto drop_it;
ptr += 6;
@@
-543,9
+541,9
@@
static int dn_route_rx_short(struct sk_buff *skb)
skb_pull(skb, 5);
skb->h.raw = skb->data;
skb_pull(skb, 5);
skb->h.raw = skb->data;
- cb->dst = *(
dn_address
*)ptr;
+ cb->dst = *(
__le16
*)ptr;
ptr += 2;
ptr += 2;
- cb->src = *(
dn_address
*)ptr;
+ cb->src = *(
__le16
*)ptr;
ptr += 2;
cb->hops = *ptr & 0x3f;
ptr += 2;
cb->hops = *ptr & 0x3f;
@@
-573,11
+571,11
@@
static int dn_route_ptp_hello(struct sk_buff *skb)
return NET_RX_SUCCESS;
}
return NET_RX_SUCCESS;
}
-int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
+int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
, struct net_device *orig_dev
)
{
struct dn_skb_cb *cb;
unsigned char flags = 0;
{
struct dn_skb_cb *cb;
unsigned char flags = 0;
- __u16 len = dn_ntohs(*(__
u
16 *)skb->data);
+ __u16 len = dn_ntohs(*(__
le
16 *)skb->data);
struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr;
unsigned char padlen = 0;
struct dn_dev *dn = (struct dn_dev *)dev->dn_ptr;
unsigned char padlen = 0;
@@
-784,7
+782,7
@@
static int dn_rt_bug(struct sk_buff *skb)
struct dn_skb_cb *cb = DN_SKB_CB(skb);
printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n",
struct dn_skb_cb *cb = DN_SKB_CB(skb);
printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n",
-
cb->src, cb->dst
);
+
dn_ntohs(cb->src), dn_ntohs(cb->dst)
);
}
kfree_skb(skb);
}
kfree_skb(skb);
@@
-818,14
+816,14
@@
static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
if (rt->u.dst.metrics[RTAX_MTU-1] == 0 ||
rt->u.dst.metrics[RTAX_MTU-1] > rt->u.dst.dev->mtu)
rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
if (rt->u.dst.metrics[RTAX_MTU-1] == 0 ||
rt->u.dst.metrics[RTAX_MTU-1] > rt->u.dst.dev->mtu)
rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
- mss = dn_mss_from_pmtu(dev, dst_
p
mtu(&rt->u.dst));
+ mss = dn_mss_from_pmtu(dev, dst_mtu(&rt->u.dst));
if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0 ||
rt->u.dst.metrics[RTAX_ADVMSS-1] > mss)
rt->u.dst.metrics[RTAX_ADVMSS-1] = mss;
return 0;
}
if (rt->u.dst.metrics[RTAX_ADVMSS-1] == 0 ||
rt->u.dst.metrics[RTAX_ADVMSS-1] > mss)
rt->u.dst.metrics[RTAX_ADVMSS-1] = mss;
return 0;
}
-static inline int dn_match_addr(__
u16 addr1, __u
16 addr2)
+static inline int dn_match_addr(__
le16 addr1, __le
16 addr2)
{
__u16 tmp = dn_ntohs(addr1) ^ dn_ntohs(addr2);
int match = 16;
{
__u16 tmp = dn_ntohs(addr1) ^ dn_ntohs(addr2);
int match = 16;
@@
-836,9
+834,9
@@
static inline int dn_match_addr(__u16 addr1, __u16 addr2)
return match;
}
return match;
}
-static __
u16 dnet_select_source(const struct net_device *dev, __u
16 daddr, int scope)
+static __
le16 dnet_select_source(const struct net_device *dev, __le
16 daddr, int scope)
{
{
- __
u
16 saddr = 0;
+ __
le
16 saddr = 0;
struct dn_dev *dn_db = dev->dn_ptr;
struct dn_ifaddr *ifa;
int best_match = 0;
struct dn_dev *dn_db = dev->dn_ptr;
struct dn_ifaddr *ifa;
int best_match = 0;
@@
-863,14
+861,14
@@
static __u16 dnet_select_source(const struct net_device *dev, __u16 daddr, int s
return saddr;
}
return saddr;
}
-static inline __
u
16 __dn_fib_res_prefsrc(struct dn_fib_res *res)
+static inline __
le
16 __dn_fib_res_prefsrc(struct dn_fib_res *res)
{
return dnet_select_source(DN_FIB_RES_DEV(*res), DN_FIB_RES_GW(*res), res->scope);
}
{
return dnet_select_source(DN_FIB_RES_DEV(*res), DN_FIB_RES_GW(*res), res->scope);
}
-static inline __
u16 dn_fib_rules_map_destination(__u
16 daddr, struct dn_fib_res *res)
+static inline __
le16 dn_fib_rules_map_destination(__le
16 daddr, struct dn_fib_res *res)
{
{
- __
u
16 mask = dnet_make_mask(res->prefixlen);
+ __
le
16 mask = dnet_make_mask(res->prefixlen);
return (daddr&~mask)|res->fi->fib_nh->nh_gw;
}
return (daddr&~mask)|res->fi->fib_nh->nh_gw;
}
@@
-894,12
+892,13
@@
static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
struct dn_fib_res res = { .fi = NULL, .type = RTN_UNICAST };
int err;
int free_res = 0;
struct dn_fib_res res = { .fi = NULL, .type = RTN_UNICAST };
int err;
int free_res = 0;
- __
u
16 gateway = 0;
+ __
le
16 gateway = 0;
if (decnet_debug_level & 16)
printk(KERN_DEBUG
"dn_route_output_slow: dst=%04x src=%04x mark=%d"
if (decnet_debug_level & 16)
printk(KERN_DEBUG
"dn_route_output_slow: dst=%04x src=%04x mark=%d"
- " iif=%d oif=%d\n", oldflp->fld_dst, oldflp->fld_src,
+ " iif=%d oif=%d\n", dn_ntohs(oldflp->fld_dst),
+ dn_ntohs(oldflp->fld_src),
oldflp->fld_fwmark, loopback_dev.ifindex, oldflp->oif);
/* If we have an output interface, verify its a DECnet device */
oldflp->fld_fwmark, loopback_dev.ifindex, oldflp->oif);
/* If we have an output interface, verify its a DECnet device */
@@
-963,8
+962,9
@@
source_ok:
if (decnet_debug_level & 16)
printk(KERN_DEBUG
"dn_route_output_slow: initial checks complete."
if (decnet_debug_level & 16)
printk(KERN_DEBUG
"dn_route_output_slow: initial checks complete."
- " dst=%o4x src=%04x oif=%d try_hard=%d\n", fl.fld_dst,
- fl.fld_src, fl.oif, try_hard);
+ " dst=%o4x src=%04x oif=%d try_hard=%d\n",
+ dn_ntohs(fl.fld_dst), dn_ntohs(fl.fld_src),
+ fl.oif, try_hard);
/*
* N.B. If the kernel is compiled without router support then
/*
* N.B. If the kernel is compiled without router support then
@@
-1220,8
+1220,8
@@
static int dn_route_input_slow(struct sk_buff *skb)
struct neighbour *neigh = NULL;
unsigned hash;
int flags = 0;
struct neighbour *neigh = NULL;
unsigned hash;
int flags = 0;
- __
u
16 gateway = 0;
- __
u
16 local_src = 0;
+ __
le
16 gateway = 0;
+ __
le
16 local_src = 0;
struct flowi fl = { .nl_u = { .dn_u =
{ .daddr = cb->dst,
.saddr = cb->src,
struct flowi fl = { .nl_u = { .dn_u =
{ .daddr = cb->dst,
.saddr = cb->src,
@@
-1268,7
+1268,7
@@
static int dn_route_input_slow(struct sk_buff *skb)
res.type = RTN_LOCAL;
flags |= RTCF_DIRECTSRC;
} else {
res.type = RTN_LOCAL;
flags |= RTCF_DIRECTSRC;
} else {
- __
u
16 src_map = fl.fld_src;
+ __
le
16 src_map = fl.fld_src;
free_res = 1;
out_dev = DN_FIB_RES_DEV(res);
free_res = 1;
out_dev = DN_FIB_RES_DEV(res);
@@
-1466,7
+1466,8
@@
int dn_route_input(struct sk_buff *skb)
return dn_route_input_slow(skb);
}
return dn_route_input_slow(skb);
}
-static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event, int nowait)
+static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
+ int event, int nowait, unsigned int flags)
{
struct dn_route *rt = (struct dn_route *)skb->dst;
struct rtmsg *r;
{
struct dn_route *rt = (struct dn_route *)skb->dst;
struct rtmsg *r;
@@
-1474,9
+1475,8
@@
static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event, int
unsigned char *b = skb->tail;
struct rta_cacheinfo ci;
unsigned char *b = skb->tail;
struct rta_cacheinfo ci;
- nlh = NLMSG_
PUT(skb, pid, seq, event, sizeof(*r)
);
+ nlh = NLMSG_
NEW(skb, pid, seq, event, sizeof(*r), flags
);
r = NLMSG_DATA(nlh);
r = NLMSG_DATA(nlh);
- nlh->nlmsg_flags = (nowait && pid) ? NLM_F_MULTI : 0;
r->rtm_family = AF_DECnet;
r->rtm_dst_len = 16;
r->rtm_src_len = 0;
r->rtm_family = AF_DECnet;
r->rtm_dst_len = 16;
r->rtm_src_len = 0;
@@
-1597,7
+1597,7
@@
int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid;
NETLINK_CB(skb).dst_pid = NETLINK_CB(in_skb).pid;
- err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, RTM_NEWROUTE, 0);
+ err = dn_rt_fill_info(skb, NETLINK_CB(in_skb).pid, nlh->nlmsg_seq, RTM_NEWROUTE, 0
, 0
);
if (err == 0)
goto out_free;
if (err == 0)
goto out_free;
@@
-1645,7
+1645,8
@@
int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
continue;
skb->dst = dst_clone(&rt->u.dst);
if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).pid,
continue;
skb->dst = dst_clone(&rt->u.dst);
if (dn_rt_fill_info(skb, NETLINK_CB(cb->skb).pid,
- cb->nlh->nlmsg_seq, RTM_NEWROUTE, 1) <= 0) {
+ cb->nlh->nlmsg_seq, RTM_NEWROUTE,
+ 1, NLM_F_MULTI) <= 0) {
dst_release(xchg(&skb->dst, NULL));
rcu_read_unlock_bh();
goto done;
dst_release(xchg(&skb->dst, NULL));
rcu_read_unlock_bh();
goto done;