From: Mark Huang Date: Tue, 1 Feb 2005 03:10:21 +0000 (+0000) Subject: - bound vnet mods by #ifdef X-Git-Tag: before-fedora-2_6_18-1_2239_FC5-vs2_0_2_2-rc6-merge~275 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2c8749f2b54dea6e8a576e0bda24c7d6e725d445;p=linux-2.6.git - bound vnet mods by #ifdef - bound runtime vnet code by if (vnet_active) --- diff --git a/include/net/sock.h b/include/net/sock.h index ede073f60..5d9789405 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1078,24 +1078,24 @@ extern void sk_reset_timer(struct sock *sk, struct timer_list* timer, extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); -extern struct proto_ops inet_stream_ops; - -extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); +extern int vnet_active; static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) { int err = 0; int skb_len; +#if defined(CONFIG_VNET) || defined(CONFIG_VNET_MODULE) /* Silently drop if VNET is active (if INET bind() has been * overridden) and the context is not entitled to read the * packet. */ - if (inet_stream_ops.bind != inet_bind && + if (vnet_active && (int) sk->sk_xid > 0 && sk->sk_xid != skb->xid) { err = -EPERM; goto out; } +#endif /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces number of warnings when compiling with -W --ANK