Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156339
b: refs/heads/master
c: a53a8b5
h: refs/heads/master
i:
  156337: d6b72f5
  156335: 4595b82
v: v3
  • Loading branch information
Ben McKeegan authored and David S. Miller committed Aug 2, 2009
1 parent b0e4f7b commit aefa51a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a924578bc4a2823a95c151f56975c71f5c156bb
refs/heads/master: a53a8b56827cc429c6d9f861ad558beeb5f6103f
34 changes: 18 additions & 16 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)

/* create a fragment for each channel */
bits = B;
while (nfree > 0 && len > 0) {
while (len > 0) {
list = list->next;
if (list == &ppp->channels) {
i = 0;
Expand Down Expand Up @@ -1431,29 +1431,31 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
*otherwise divide it according to the speed
*of the channel we are going to transmit on
*/
if (pch->speed == 0) {
flen = totlen/nfree ;
if (nbigger > 0) {
flen++;
nbigger--;
}
} else {
flen = (((totfree - nzero)*(totlen + hdrlen*totfree)) /
((totspeed*totfree)/pch->speed)) - hdrlen;
if (nbigger > 0) {
flen += ((totfree - nzero)*pch->speed)/totspeed;
nbigger -= ((totfree - nzero)*pch->speed)/
if (nfree > 0) {
if (pch->speed == 0) {
flen = totlen/nfree ;
if (nbigger > 0) {
flen++;
nbigger--;
}
} else {
flen = (((totfree - nzero)*(totlen + hdrlen*totfree)) /
((totspeed*totfree)/pch->speed)) - hdrlen;
if (nbigger > 0) {
flen += ((totfree - nzero)*pch->speed)/totspeed;
nbigger -= ((totfree - nzero)*pch->speed)/
totspeed;
}
}
nfree--;
}
nfree--;

/*
*check if we are on the last channel or
*we exceded the lenght of the data to
*fragment
*/
if ((nfree == 0) || (flen > len))
if ((nfree <= 0) || (flen > len))
flen = len;
/*
*it is not worth to tx on slow channels:
Expand All @@ -1467,7 +1469,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
continue;
}

mtu = pch->chan->mtu + 2 - hdrlen;
mtu = pch->chan->mtu - hdrlen;
if (mtu < 4)
mtu = 4;
if (flen > mtu)
Expand Down

0 comments on commit aefa51a

Please sign in to comment.