From: Mark Huang Date: Fri, 4 Mar 2005 13:59:08 +0000 (+0000) Subject: - merge revision 1.16 X-Git-Tag: planetlab-3_0-rc13~8 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fa00f0d3f0999e09217eb4d8dd4b222e7f1f8b6b;p=linux-2.6.git - merge revision 1.16 date: 2005/02/01 03:16:01; author: mlhuang; state: Exp; lines: +9 -9 - bound vnet mods by #ifdef - bound runtime vnet code by if (vnet_active) --- diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 8751f21c7..200003f1c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1762,10 +1762,6 @@ csum_err: goto discard; } -extern struct proto_ops inet_stream_ops; - -extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); - /* * From tcp_input.c */ @@ -1817,11 +1813,11 @@ int tcp_v4_rcv(struct sk_buff *skb) goto no_tcp_socket; process: - /* Silently drop if VNET is active (if INET bind() has been - * overridden) and the context is not entitled to read the - * packet. +#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE) + /* Silently drop if VNET is active and the context is not + * entitled to read the packet. */ - if (inet_stream_ops.bind != inet_bind) { + if (vnet_active) { /* Transfer ownership of reusable TIME_WAIT buckets to * whomever VNET decided should own the packet. */ @@ -1831,6 +1827,7 @@ process: if ((int) sk->sk_xid > 0 && sk->sk_xid != skb->xid) goto discard_it; } +#endif if (sk->sk_state == TCP_TIME_WAIT) goto do_time_wait; @@ -1863,8 +1860,11 @@ no_tcp_socket: if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { bad_packet: TCP_INC_STATS_BH(TCP_MIB_INERRS); - } else if (!skb->sk) { +#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE) + } else if (vnet_active && skb->sk) { /* VNET: Suppress RST if the port was bound to a (presumably raw) socket */ +#endif + } else { tcp_v4_send_reset(skb); }