diff -ruNp linux-2.4.19/net/ipv4/tcp_ipv4.c linux-2.4.19-glee/net/ipv4/tcp_ipv4.c --- linux-2.4.19/net/ipv4/tcp_ipv4.c 2002-08-03 19:26:04.000000000 +1000 +++ linux-2.4.19-glee/net/ipv4/tcp_ipv4.c 2002-08-10 19:34:24.000000000 +1000 @@ -763,6 +763,9 @@ int tcp_v4_connect(struct sock *sk, stru if (usin->sin_family != AF_INET) return(-EAFNOSUPPORT); + if (usin->sin_port == 0) + return(-EADDRNOTAVAIL); + nexthop = daddr = usin->sin_addr.s_addr; if (sk->protinfo.af_inet.opt && sk->protinfo.af_inet.opt->srr) { if (daddr == 0) diff -ruNp linux-2.4.19/net/ipv4/udp.c linux-2.4.19-glee/net/ipv4/udp.c --- linux-2.4.19/net/ipv4/udp.c 2002-08-03 19:26:04.000000000 +1000 +++ linux-2.4.19-glee/net/ipv4/udp.c 2002-08-10 19:34:52.000000000 +1000 @@ -723,6 +723,9 @@ int udp_connect(struct sock *sk, struct if (usin->sin_family != AF_INET) return -EAFNOSUPPORT; + if (usin->sin_port == 0) + return -EADDRNOTAVAIL; + sk_dst_reset(sk); oif = sk->bound_dev_if; diff -ruNp linux-2.4.19/net/ipv6/tcp_ipv6.c linux-2.4.19-glee/net/ipv6/tcp_ipv6.c --- linux-2.4.19/net/ipv6/tcp_ipv6.c 2002-08-03 19:26:04.000000000 +1000 +++ linux-2.4.19-glee/net/ipv6/tcp_ipv6.c 2002-08-10 19:35:57.000000000 +1000 @@ -539,6 +539,9 @@ static int tcp_v6_connect(struct sock *s if (usin->sin6_family != AF_INET6) return(-EAFNOSUPPORT); + if (usin->sin6_port == 0) + return -EADDRNOTAVAIL; + fl.fl6_flowlabel = 0; if (np->sndflow) { fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK; diff -ruNp linux-2.4.19/net/ipv6/udp.c linux-2.4.19-glee/net/ipv6/udp.c --- linux-2.4.19/net/ipv6/udp.c 2002-08-03 19:26:04.000000000 +1000 +++ linux-2.4.19-glee/net/ipv6/udp.c 2002-08-10 19:36:22.000000000 +1000 @@ -231,6 +231,9 @@ int udpv6_connect(struct sock *sk, struc if (usin->sin6_family != AF_INET6) return -EAFNOSUPPORT; + if (usin->sin6_port == 0) + return -EADDRNOTAVAIL; + fl.fl6_flowlabel = 0; if (np->sndflow) { fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK; diff -ruNp linux-2.4.19/net/socket.c linux-2.4.19-glee/net/socket.c --- linux-2.4.19/net/socket.c 2002-08-03 19:26:04.000000000 +1000 +++ linux-2.4.19-glee/net/socket.c 2002-08-10 19:37:23.000000000 +1000 @@ -1118,6 +1118,9 @@ asmlinkage long sys_connect(int fd, stru out_put: sockfd_put(sock); out: + if (signal_pending(current)) + return -EINTR; + return err; }