diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
commit | 4a35ecf8bf1c4b039503fa554100fe85c761de76 (patch) | |
tree | 9b75f5d5636004d9a9aa496924377379be09aa1f /net/ipv4/af_inet.c | |
parent | b4d562e3c3553ac58c7120555c4e4aefbb090a2a (diff) | |
parent | fb9e2d887243499b8d28efcf80821c4f6a092395 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bonding/bond_main.c
drivers/net/via-velocity.c
drivers/net/wireless/iwlwifi/iwl-agn.c
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 55e11906a73a..b5924f178812 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -530,6 +530,8 @@ int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr, | |||
530 | { | 530 | { |
531 | struct sock *sk = sock->sk; | 531 | struct sock *sk = sock->sk; |
532 | 532 | ||
533 | if (addr_len < sizeof(uaddr->sa_family)) | ||
534 | return -EINVAL; | ||
533 | if (uaddr->sa_family == AF_UNSPEC) | 535 | if (uaddr->sa_family == AF_UNSPEC) |
534 | return sk->sk_prot->disconnect(sk, flags); | 536 | return sk->sk_prot->disconnect(sk, flags); |
535 | 537 | ||
@@ -573,6 +575,9 @@ int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, | |||
573 | int err; | 575 | int err; |
574 | long timeo; | 576 | long timeo; |
575 | 577 | ||
578 | if (addr_len < sizeof(uaddr->sa_family)) | ||
579 | return -EINVAL; | ||
580 | |||
576 | lock_sock(sk); | 581 | lock_sock(sk); |
577 | 582 | ||
578 | if (uaddr->sa_family == AF_UNSPEC) { | 583 | if (uaddr->sa_family == AF_UNSPEC) { |