projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[linux-2.6-block.git]
/
net
/
ipv4
/
ip_fragment.c
diff --git
a/net/ipv4/ip_fragment.c
b/net/ipv4/ip_fragment.c
index 8b448c4b90802f23c83c43770bc38b9d6d8b0249..cd6ce6ac635843e4598e5332c32256bb0ff93926 100644
(file)
--- a/
net/ipv4/ip_fragment.c
+++ b/
net/ipv4/ip_fragment.c
@@
-194,7
+194,7
@@
static void ip_expire(unsigned long arg)
spin_lock(&qp->q.lock);
spin_lock(&qp->q.lock);
- if (qp->q.last_in & COMPLETE)
+ if (qp->q.last_in &
INET_FRAG_
COMPLETE)
goto out;
ipq_kill(qp);
goto out;
ipq_kill(qp);
@@
-202,7
+202,7
@@
static void ip_expire(unsigned long arg)
IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
- if ((qp->q.last_in
&
FIRST_IN) && qp->q.fragments != NULL) {
+ if ((qp->q.last_in
& INET_FRAG_
FIRST_IN) && qp->q.fragments != NULL) {
struct sk_buff *head = qp->q.fragments;
struct net *net;
struct sk_buff *head = qp->q.fragments;
struct net *net;
@@
-301,7
+301,7
@@
static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
int ihl, end;
int err = -ENOENT;
int ihl, end;
int err = -ENOENT;
- if (qp->q.last_in & COMPLETE)
+ if (qp->q.last_in &
INET_FRAG_
COMPLETE)
goto err;
if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) &&
goto err;
if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) &&
@@
-327,9
+327,9
@@
static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
* or have different end, the segment is corrrupted.
*/
if (end < qp->q.len ||
* or have different end, the segment is corrrupted.
*/
if (end < qp->q.len ||
- ((qp->q.last_in & LAST_IN) && end != qp->q.len))
+ ((qp->q.last_in &
INET_FRAG_
LAST_IN) && end != qp->q.len))
goto err;
goto err;
- qp->q.last_in |= LAST_IN;
+ qp->q.last_in |=
INET_FRAG_
LAST_IN;
qp->q.len = end;
} else {
if (end&7) {
qp->q.len = end;
} else {
if (end&7) {
@@
-339,7
+339,7
@@
static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
}
if (end > qp->q.len) {
/* Some bits beyond end -> corruption. */
}
if (end > qp->q.len) {
/* Some bits beyond end -> corruption. */
- if (qp->q.last_in & LAST_IN)
+ if (qp->q.last_in &
INET_FRAG_
LAST_IN)
goto err;
qp->q.len = end;
}
goto err;
qp->q.len = end;
}
@@
-438,9
+438,10
@@
static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
qp->q.meat += skb->len;
atomic_add(skb->truesize, &qp->q.net->mem);
if (offset == 0)
qp->q.meat += skb->len;
atomic_add(skb->truesize, &qp->q.net->mem);
if (offset == 0)
- qp->q.last_in |= FIRST_IN;
+ qp->q.last_in |=
INET_FRAG_
FIRST_IN;
- if (qp->q.last_in == (FIRST_IN | LAST_IN) && qp->q.meat == qp->q.len)
+ if (qp->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
+ qp->q.meat == qp->q.len)
return ip_frag_reasm(qp, prev, dev);
write_lock(&ip4_frags.lock);
return ip_frag_reasm(qp, prev, dev);
write_lock(&ip4_frags.lock);
@@
-556,7
+557,7
@@
out_nomem:
out_oversize:
if (net_ratelimit())
printk(KERN_INFO
out_oversize:
if (net_ratelimit())
printk(KERN_INFO
- "Oversized IP packet from
%d.%d.%d.%d
.\n",
+ "Oversized IP packet from
" NIPQUAD_FMT "
.\n",
NIPQUAD(qp->saddr));
out_fail:
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
NIPQUAD(qp->saddr));
out_fail:
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
@@
-571,7
+572,7
@@
int ip_defrag(struct sk_buff *skb, u32 user)
IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
- net = skb->dev ?
skb->dev->nd_net : skb->dst->dev->nd_net
;
+ net = skb->dev ?
dev_net(skb->dev) : dev_net(skb->dst->dev)
;
/* Start by cleaning up the memory. */
if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh)
ip_evictor(net);
/* Start by cleaning up the memory. */
if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh)
ip_evictor(net);