Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [LAPB]: Fix windowsize check
  [TCP]: Fixes IW > 2 cases when TCP is application limited
  [PKT_SCHED] RED: Fix overflow in calculation of queue average
  [LLX]: SOCK_DGRAM interface fixes
  [PKT_SCHED]: Return ENOENT if qdisc module is unavailable
  [BRIDGE]: netlink status fix
  • Loading branch information
Linus Torvalds committed Aug 6, 2006
2 parents 3e3183b + 558e10a commit cb3f1e7
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion include/net/red.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(struct red_parms *p)
* Seems, it is the best solution to
* problem of too coarse exponent tabulation.
*/
us_idle = (p->qavg * us_idle) >> p->Scell_log;
us_idle = (p->qavg * (u64)us_idle) >> p->Scell_log;

if (us_idle < (p->qavg >> 1))
return p->qavg - us_idle;
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void br_ifinfo_notify(int event, struct net_bridge_port *port)
goto err_out;

err = br_fill_ifinfo(skb, port, current->pid, 0, event, 0);
if (err)
if (err < 0)
goto err_kfree;

NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
Expand Down
3 changes: 2 additions & 1 deletion net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -3541,7 +3541,8 @@ void tcp_cwnd_application_limited(struct sock *sk)
if (inet_csk(sk)->icsk_ca_state == TCP_CA_Open &&
sk->sk_socket && !test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
/* Limited by application or receiver window. */
u32 win_used = max(tp->snd_cwnd_used, 2U);
u32 init_win = tcp_init_cwnd(tp, __sk_dst_get(sk));
u32 win_used = max(tp->snd_cwnd_used, init_win);
if (win_used < tp->snd_cwnd) {
tp->snd_ssthresh = tcp_current_ssthresh(sk);
tp->snd_cwnd = (tp->snd_cwnd + win_used) >> 1;
Expand Down
12 changes: 7 additions & 5 deletions net/lapb/lapb_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,13 @@ int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms)
goto out_put;

if (lapb->state == LAPB_STATE_0) {
if (((parms->mode & LAPB_EXTENDED) &&
(parms->window < 1 || parms->window > 127)) ||
(parms->window < 1 || parms->window > 7))
goto out_put;

if (parms->mode & LAPB_EXTENDED) {
if (parms->window < 1 || parms->window > 127)
goto out_put;
} else {
if (parms->window < 1 || parms->window > 7)
goto out_put;
}
lapb->mode = parms->mode;
lapb->window = parms->window;
}
Expand Down
20 changes: 8 additions & 12 deletions net/llc/af_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,24 +784,20 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
copied += used;
len -= used;

if (used + offset < skb->len)
continue;

if (!(flags & MSG_PEEK)) {
sk_eat_skb(sk, skb, 0);
*seq = 0;
}

/* For non stream protcols we get one packet per recvmsg call */
if (sk->sk_type != SOCK_STREAM)
goto copy_uaddr;

/* Partial read */
if (used + offset < skb->len)
continue;
} while (len > 0);

/*
* According to UNIX98, msg_name/msg_namelen are ignored
* on connected socket. -ANK
* But... af_llc still doesn't have separate sets of methods for
* SOCK_DGRAM and SOCK_STREAM :-( So we have to do this test, will
* eventually fix this tho :-) -acme
*/
if (sk->sk_type == SOCK_DGRAM)
goto copy_uaddr;
out:
release_sock(sk);
return copied;
Expand Down
4 changes: 2 additions & 2 deletions net/llc/llc_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ void llc_save_primitive(struct sock *sk, struct sk_buff* skb, u8 prim)
{
struct sockaddr_llc *addr;

if (skb->sk->sk_type == SOCK_STREAM) /* See UNIX98 */
return;
/* save primitive for use by the user. */
addr = llc_ui_skb_cb(skb);

memset(addr, 0, sizeof(*addr));
addr->sllc_family = sk->sk_family;
addr->sllc_arphrd = skb->dev->type;
addr->sllc_test = prim == LLC_TEST_PRIM;
Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
}
#endif

err = -EINVAL;
err = -ENOENT;
if (ops == NULL)
goto err_out;

Expand Down

0 comments on commit cb3f1e7

Please sign in to comment.