亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ip_vs_xmit.c

?? 優龍2410linux2.6.8內核源代碼
?? C
字號:
/* * ip_vs_xmit.c: various packet transmitters for IPVS * * Version:     $Id: ip_vs_xmit.c,v 1.2 2002/11/30 01:50:35 wensong Exp $ * * Authors:     Wensong Zhang <wensong@linuxvirtualserver.org> *              Julian Anastasov <ja@ssi.bg> * *              This program is free software; you can redistribute it and/or *              modify it under the terms of the GNU General Public License *              as published by the Free Software Foundation; either version *              2 of the License, or (at your option) any later version. * * Changes: * */#include <linux/kernel.h>#include <linux/ip.h>#include <linux/tcp.h>                  /* for tcphdr */#include <net/tcp.h>                    /* for csum_tcpudp_magic */#include <net/udp.h>#include <net/icmp.h>                   /* for icmp_send */#include <net/route.h>                  /* for ip_route_output */#include <linux/netfilter.h>#include <linux/netfilter_ipv4.h>#include <net/ip_vs.h>/* *      Destination cache to speed up outgoing route lookup */static inline void__ip_vs_dst_set(struct ip_vs_dest *dest, u32 rtos, struct dst_entry *dst){	struct dst_entry *old_dst;	old_dst = dest->dst_cache;	dest->dst_cache = dst;	dest->dst_rtos = rtos;	dst_release(old_dst);}static inline struct dst_entry *__ip_vs_dst_check(struct ip_vs_dest *dest, u32 rtos, u32 cookie){	struct dst_entry *dst = dest->dst_cache;	if (!dst)		return NULL;	if ((dst->obsolete || rtos != dest->dst_rtos) &&	    dst->ops->check(dst, cookie) == NULL) {		dest->dst_cache = NULL;		return NULL;	}	dst_hold(dst);	return dst;}static inline struct rtable *__ip_vs_get_out_rt(struct ip_vs_conn *cp, u32 rtos){	struct rtable *rt;			/* Route to the other host */	struct ip_vs_dest *dest = cp->dest;	if (dest) {		spin_lock(&dest->dst_lock);		if (!(rt = (struct rtable *)		      __ip_vs_dst_check(dest, rtos, 0))) {			struct flowi fl = {				.oif = 0,				.nl_u = {					.ip4_u = {						.daddr = dest->addr,						.saddr = 0,						.tos = rtos, } },			};			if (ip_route_output_key(&rt, &fl)) {				spin_unlock(&dest->dst_lock);				IP_VS_DBG_RL("ip_route_output error, "					     "dest: %u.%u.%u.%u\n",					     NIPQUAD(dest->addr));				return NULL;			}			__ip_vs_dst_set(dest, rtos, dst_clone(&rt->u.dst));			IP_VS_DBG(10, "new dst %u.%u.%u.%u, refcnt=%d, rtos=%X\n",				  NIPQUAD(dest->addr),				  atomic_read(&rt->u.dst.__refcnt), rtos);		}		spin_unlock(&dest->dst_lock);	} else {		struct flowi fl = {			.oif = 0,			.nl_u = {				.ip4_u = {					.daddr = cp->daddr,					.saddr = 0,					.tos = rtos, } },		};		if (ip_route_output_key(&rt, &fl)) {			IP_VS_DBG_RL("ip_route_output error, dest: "				     "%u.%u.%u.%u\n", NIPQUAD(cp->daddr));			return NULL;		}	}	return rt;}/* *	Release dest->dst_cache before a dest is removed */voidip_vs_dst_reset(struct ip_vs_dest *dest){	struct dst_entry *old_dst;	old_dst = dest->dst_cache;	dest->dst_cache = NULL;	dst_release(old_dst);}#define IP_VS_XMIT(skb, rt)				\do {							\	(skb)->nfcache |= NFC_IPVS_PROPERTY;		\	NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL,	\		(rt)->u.dst.dev, dst_output);		\} while (0)/* *      NULL transmitter (do nothing except return NF_ACCEPT) */intip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,		struct ip_vs_protocol *pp){	/* we do not touch skb and do not need pskb ptr */	return NF_ACCEPT;}/* *      Bypass transmitter *      Let packets bypass the destination when the destination is not *      available, it may be only used in transparent cache cluster. */intip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,		  struct ip_vs_protocol *pp){	struct rtable *rt;			/* Route to the other host */	struct iphdr  *iph = skb->nh.iph;	u8     tos = iph->tos;	int    mtu;	struct flowi fl = {		.oif = 0,		.nl_u = {			.ip4_u = {				.daddr = iph->daddr,				.saddr = 0,				.tos = RT_TOS(tos), } },	};	EnterFunction(10);	if (ip_route_output_key(&rt, &fl)) {		IP_VS_DBG_RL("ip_vs_bypass_xmit(): ip_route_output error, "			     "dest: %u.%u.%u.%u\n", NIPQUAD(iph->daddr));		goto tx_error_icmp;	}	/* MTU checking */	mtu = dst_pmtu(&rt->u.dst);	if ((skb->len > mtu) && (iph->frag_off&__constant_htons(IP_DF))) {		ip_rt_put(rt);		icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));		IP_VS_DBG_RL("ip_vs_bypass_xmit(): frag needed\n");		goto tx_error;	}	/*	 * Call ip_send_check because we are not sure it is called	 * after ip_defrag. Is copy-on-write needed?	 */	if (unlikely((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)) {		ip_rt_put(rt);		return NF_STOLEN;	}	ip_send_check(skb->nh.iph);	/* drop old route */	dst_release(skb->dst);	skb->dst = &rt->u.dst;	/* Another hack: avoid icmp_send in ip_fragment */	skb->local_df = 1;#ifdef CONFIG_NETFILTER_DEBUG	skb->nf_debug = 0;#endif /* CONFIG_NETFILTER_DEBUG */	IP_VS_XMIT(skb, rt);	LeaveFunction(10);	return NF_STOLEN; tx_error_icmp:	dst_link_failure(skb); tx_error:	kfree_skb(skb);	LeaveFunction(10);	return NF_STOLEN;}/* *      NAT transmitter (only for outside-to-inside nat forwarding) *      Not used for related ICMP */intip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,	       struct ip_vs_protocol *pp){	struct rtable *rt;		/* Route to the other host */	int mtu;	struct iphdr *iph = skb->nh.iph;	EnterFunction(10);	/* check if it is a connection of no-client-port */	if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) {		__u16 pt;		if (skb_copy_bits(skb, iph->ihl*4, &pt, sizeof(pt)) < 0)			goto tx_error;		ip_vs_conn_fill_cport(cp, pt);		IP_VS_DBG(10, "filled cport=%d\n", ntohs(pt));	}	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(iph->tos))))		goto tx_error_icmp;	/* MTU checking */	mtu = dst_pmtu(&rt->u.dst);	if ((skb->len > mtu) && (iph->frag_off&__constant_htons(IP_DF))) {		ip_rt_put(rt);		icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));		IP_VS_DBG_RL_PKT(0, pp, skb, 0, "ip_vs_nat_xmit(): frag needed for");		goto tx_error;	}	/* copy-on-write the packet before mangling it */	if (!ip_vs_make_skb_writable(&skb, sizeof(struct iphdr)))		goto tx_error_put;	if (skb_cow(skb, rt->u.dst.dev->hard_header_len))		goto tx_error_put;	/* drop old route */	dst_release(skb->dst);	skb->dst = &rt->u.dst;	/* mangle the packet */	if (pp->dnat_handler && !pp->dnat_handler(&skb, pp, cp))		goto tx_error;	skb->nh.iph->daddr = cp->daddr;	ip_send_check(skb->nh.iph);	IP_VS_DBG_PKT(10, pp, skb, 0, "After DNAT");	/* FIXME: when application helper enlarges the packet and the length	   is larger than the MTU of outgoing device, there will be still	   MTU problem. */	/* Another hack: avoid icmp_send in ip_fragment */	skb->local_df = 1;#ifdef CONFIG_NETFILTER_DEBUG	skb->nf_debug = 0;#endif /* CONFIG_NETFILTER_DEBUG */	IP_VS_XMIT(skb, rt);	LeaveFunction(10);	return NF_STOLEN;  tx_error_icmp:	dst_link_failure(skb);  tx_error:	LeaveFunction(10);	kfree_skb(skb);	return NF_STOLEN;  tx_error_put:	ip_rt_put(rt);	goto tx_error;}/* *   IP Tunneling transmitter * *   This function encapsulates the packet in a new IP packet, its *   destination will be set to cp->daddr. Most code of this function *   is taken from ipip.c. * *   It is used in VS/TUN cluster. The load balancer selects a real *   server from a cluster based on a scheduling algorithm, *   encapsulates the request packet and forwards it to the selected *   server. For example, all real servers are configured with *   "ifconfig tunl0 <Virtual IP Address> up". When the server receives *   the encapsulated packet, it will decapsulate the packet, processe *   the request and return the response packets directly to the client *   without passing the load balancer. This can greatly increase the *   scalability of virtual server. * *   Used for ANY protocol */intip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,		  struct ip_vs_protocol *pp){	struct rtable *rt;			/* Route to the other host */	struct net_device *tdev;		/* Device to other host */	struct iphdr  *old_iph = skb->nh.iph;	u8     tos = old_iph->tos;	u16    df = old_iph->frag_off;	struct iphdr  *iph;			/* Our new IP header */	int    max_headroom;			/* The extra header space needed */	int    mtu;	EnterFunction(10);	if (skb->protocol != __constant_htons(ETH_P_IP)) {		IP_VS_DBG_RL("ip_vs_tunnel_xmit(): protocol error, "			     "ETH_P_IP: %d, skb protocol: %d\n",			     __constant_htons(ETH_P_IP), skb->protocol);		goto tx_error;	}	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(tos))))		goto tx_error_icmp;	tdev = rt->u.dst.dev;	mtu = dst_pmtu(&rt->u.dst) - sizeof(struct iphdr);	if (mtu < 68) {		ip_rt_put(rt);		IP_VS_DBG_RL("ip_vs_tunnel_xmit(): mtu less than 68\n");		goto tx_error;	}	if (skb->dst)		skb->dst->ops->update_pmtu(skb->dst, mtu);	df |= (old_iph->frag_off&__constant_htons(IP_DF));	if ((old_iph->frag_off&__constant_htons(IP_DF))	    && mtu < ntohs(old_iph->tot_len)) {		icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));		ip_rt_put(rt);		IP_VS_DBG_RL("ip_vs_tunnel_xmit(): frag needed\n");		goto tx_error;	}	/*	 * Okay, now see if we can stuff it in the buffer as-is.	 */	max_headroom = LL_RESERVED_SPACE(tdev) + sizeof(struct iphdr);	if (skb_headroom(skb) < max_headroom	    || skb_cloned(skb) || skb_shared(skb)) {		struct sk_buff *new_skb =			skb_realloc_headroom(skb, max_headroom);		if (!new_skb) {			ip_rt_put(rt);			kfree_skb(skb);			IP_VS_ERR_RL("ip_vs_tunnel_xmit(): no memory\n");			return NF_STOLEN;		}		kfree_skb(skb);		skb = new_skb;		old_iph = skb->nh.iph;	}	skb->h.raw = (void *) old_iph;	/* fix old IP header checksum */	ip_send_check(old_iph);	skb->nh.raw = skb_push(skb, sizeof(struct iphdr));	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));	/* drop old route */	dst_release(skb->dst);	skb->dst = &rt->u.dst;	/*	 *	Push down and install the IPIP header.	 */	iph			=	skb->nh.iph;	iph->version		=	4;	iph->ihl		=	sizeof(struct iphdr)>>2;	iph->frag_off		=	df;	iph->protocol		=	IPPROTO_IPIP;	iph->tos		=	tos;	iph->daddr		=	rt->rt_dst;	iph->saddr		=	rt->rt_src;	iph->ttl		=	old_iph->ttl;	iph->tot_len		=	htons(skb->len);	ip_select_ident(iph, &rt->u.dst, NULL);	ip_send_check(iph);	skb->ip_summed = CHECKSUM_NONE;	/* Another hack: avoid icmp_send in ip_fragment */	skb->local_df = 1;#ifdef CONFIG_NETFILTER_DEBUG	skb->nf_debug = 0;#endif /* CONFIG_NETFILTER_DEBUG */	IP_VS_XMIT(skb, rt);	LeaveFunction(10);	return NF_STOLEN;  tx_error_icmp:	dst_link_failure(skb);  tx_error:	kfree_skb(skb);	LeaveFunction(10);	return NF_STOLEN;}/* *      Direct Routing transmitter *      Used for ANY protocol */intip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,	      struct ip_vs_protocol *pp){	struct rtable *rt;			/* Route to the other host */	struct iphdr  *iph = skb->nh.iph;	int    mtu;	EnterFunction(10);	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(iph->tos))))		goto tx_error_icmp;	/* MTU checking */	mtu = dst_pmtu(&rt->u.dst);	if ((iph->frag_off&__constant_htons(IP_DF)) && skb->len > mtu) {		icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));		ip_rt_put(rt);		IP_VS_DBG_RL("ip_vs_dr_xmit(): frag needed\n");		goto tx_error;	}	/*	 * Call ip_send_check because we are not sure it is called	 * after ip_defrag. Is copy-on-write needed?	 */	if (unlikely((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)) {		ip_rt_put(rt);		return NF_STOLEN;	}	ip_send_check(skb->nh.iph);	/* drop old route */	dst_release(skb->dst);	skb->dst = &rt->u.dst;	/* Another hack: avoid icmp_send in ip_fragment */	skb->local_df = 1;#ifdef CONFIG_NETFILTER_DEBUG	skb->nf_debug = 0;#endif /* CONFIG_NETFILTER_DEBUG */	IP_VS_XMIT(skb, rt);	LeaveFunction(10);	return NF_STOLEN;  tx_error_icmp:	dst_link_failure(skb);  tx_error:	kfree_skb(skb);	LeaveFunction(10);	return NF_STOLEN;}/* *	ICMP packet transmitter *	called by the ip_vs_in_icmp */intip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,		struct ip_vs_protocol *pp, int offset){	struct rtable	*rt;	/* Route to the other host */	int mtu;	int rc;	EnterFunction(10);	/* The ICMP packet for VS/TUN, VS/DR and LOCALNODE will be	   forwarded directly here, because there is no need to	   translate address/port back */	if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {		if (cp->packet_xmit)			rc = cp->packet_xmit(skb, cp, pp);		else			rc = NF_ACCEPT;		/* do not touch skb anymore */		atomic_inc(&cp->in_pkts);		__ip_vs_conn_put(cp);		goto out;	}	/*	 * mangle and send the packet here (only for VS/NAT)	 */	if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(skb->nh.iph->tos))))		goto tx_error_icmp;	/* MTU checking */	mtu = dst_pmtu(&rt->u.dst);	if ((skb->len > mtu) && (skb->nh.iph->frag_off&__constant_htons(IP_DF))) {		ip_rt_put(rt);		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));		IP_VS_DBG_RL("ip_vs_in_icmp(): frag needed\n");		goto tx_error;	}	/* copy-on-write the packet before mangling it */	if (!ip_vs_make_skb_writable(&skb, offset))		goto tx_error_put;	if (skb_cow(skb, rt->u.dst.dev->hard_header_len))		goto tx_error_put;	/* drop the old route when skb is not shared */	dst_release(skb->dst);	skb->dst = &rt->u.dst;	ip_vs_nat_icmp(skb, pp, cp, 0);	/* Another hack: avoid icmp_send in ip_fragment */	skb->local_df = 1;#ifdef CONFIG_NETFILTER_DEBUG	skb->nf_debug = 0;#endif /* CONFIG_NETFILTER_DEBUG */	IP_VS_XMIT(skb, rt);	rc = NF_STOLEN;	goto out;  tx_error_icmp:	dst_link_failure(skb);  tx_error:	dev_kfree_skb(skb);	rc = NF_STOLEN;  out:	LeaveFunction(10);	return rc;  tx_error_put:	ip_rt_put(rt);	goto tx_error;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
1区2区3区精品视频| 国产激情偷乱视频一区二区三区| 免费观看久久久4p| 风间由美一区二区av101 | 日产精品久久久久久久性色 | 午夜视频在线观看一区| 国产一级精品在线| 欧美日韩免费在线视频| 欧美国产在线观看| 老司机精品视频在线| 色婷婷激情综合| 国产精品无码永久免费888| 男女男精品网站| 在线视频你懂得一区二区三区| 久久久久久久久久久久电影| 日本不卡中文字幕| 欧美色综合天天久久综合精品| 亚洲国产精品二十页| 国产乱码精品1区2区3区| 欧美一区中文字幕| 亚洲国产成人av| 色婷婷激情一区二区三区| 国产精品久久三| 丁香啪啪综合成人亚洲小说| 久久一区二区视频| 国产精一品亚洲二区在线视频| 91精品国产一区二区| 偷拍与自拍一区| 欧美日韩精品欧美日韩精品一| 一区二区三区日韩精品视频| 色综合天天综合在线视频| 国产精品成人免费在线| av在线综合网| 一区二区三区四区不卡在线| 色综合久久88色综合天天免费| 亚洲欧洲日韩综合一区二区| www.亚洲免费av| 自拍av一区二区三区| 成人免费毛片嘿嘿连载视频| 欧美激情一区二区三区四区| 不卡影院免费观看| 亚洲日本va午夜在线电影| 91在线视频免费91| 一区二区三区在线不卡| 欧美亚洲自拍偷拍| 日韩电影在线看| 26uuu国产一区二区三区| 国产精品亚洲一区二区三区在线| 久久久777精品电影网影网| 成人一区二区三区视频| 亚洲综合色视频| 欧美色爱综合网| 久久精品久久99精品久久| 久久蜜桃一区二区| av不卡免费在线观看| 亚洲国产va精品久久久不卡综合| 日韩视频免费观看高清在线视频| 精品在线你懂的| 国产精品电影一区二区三区| 欧美日韩精品免费| 国产一区中文字幕| 亚洲三级小视频| 欧美v日韩v国产v| 99久久久国产精品| 欧美aaa在线| 中文字幕在线不卡视频| 欧美三级欧美一级| 国产精品99久久久久久久女警| 亚洲男人的天堂一区二区| 欧美日韩视频在线观看一区二区三区 | 偷窥国产亚洲免费视频| 久久伊人蜜桃av一区二区| 日本久久精品电影| 久久精品国产亚洲高清剧情介绍 | 亚洲成年人网站在线观看| 2021国产精品久久精品| 日本二三区不卡| 极品少妇一区二区| 亚洲一区二区三区不卡国产欧美| 欧美成人艳星乳罩| 欧美日精品一区视频| 丁香一区二区三区| 免费久久99精品国产| 亚洲精品欧美综合四区| 精品国产区一区| 在线播放一区二区三区| av亚洲精华国产精华| 久久 天天综合| 日韩精品乱码av一区二区| 国产精品免费aⅴ片在线观看| 91精品国产乱码| 在线视频国内自拍亚洲视频| 成人午夜视频福利| 理论电影国产精品| 日韩高清中文字幕一区| 一区二区三区美女视频| 亚洲丝袜另类动漫二区| 国产欧美日韩综合精品一区二区| 日韩一级高清毛片| 欧美人妖巨大在线| 91视频精品在这里| 成人动漫中文字幕| 国产91富婆露脸刺激对白| 久久99精品久久久久久国产越南| 五月开心婷婷久久| 亚洲mv大片欧洲mv大片精品| 亚洲精品成人在线| 亚洲欧美日韩小说| 亚洲精品老司机| 亚洲激情图片小说视频| 日本亚洲免费观看| 亚洲国产日韩在线一区模特| 亚洲午夜三级在线| 亚洲1区2区3区视频| 亚洲国产精品久久人人爱蜜臀| 亚洲日本护士毛茸茸| 一区二区三区在线观看视频| 一区二区三区资源| 亚洲国产精品精华液网站| 亚洲成人免费电影| 视频一区视频二区中文| 日韩激情视频在线观看| 日本色综合中文字幕| 日韩av二区在线播放| 国产中文字幕一区| 国产精品99久久久久久似苏梦涵 | 欧美精品久久一区二区三区| 欧美三级资源在线| 91精品中文字幕一区二区三区| 欧美一区二区三区免费| 精品日韩欧美一区二区| 国产欧美一区二区精品性| 亚洲免费在线播放| 五月婷婷综合在线| 精品中文字幕一区二区小辣椒| 国产91精品在线观看| 99久久精品免费| 欧美日韩国产一区| 精品国产髙清在线看国产毛片| 久久精品欧美一区二区三区不卡 | 在线亚洲一区观看| 欧美高清性hdvideosex| 久久九九影视网| 一区二区三区欧美久久| 精品在线播放午夜| 97aⅴ精品视频一二三区| 欧美少妇xxx| 久久久午夜精品理论片中文字幕| 中文字幕亚洲不卡| 日本亚洲三级在线| 99精品一区二区| 欧美日韩成人在线| 亚洲欧洲成人精品av97| 偷拍一区二区三区| 成人av在线网站| 欧美一区二区视频免费观看| 日韩理论片在线| 韩国一区二区三区| 欧美日韩国产美女| 国产农村妇女毛片精品久久麻豆 | 日韩一级片在线播放| 中文字幕在线不卡国产视频| 麻豆freexxxx性91精品| 99re6这里只有精品视频在线观看| 91精品中文字幕一区二区三区| 自拍偷拍国产亚洲| 国产黑丝在线一区二区三区| 9191国产精品| 亚洲欧美激情小说另类| 国内外成人在线| 91精品国产全国免费观看| 亚洲免费观看高清完整版在线 | 亚洲综合一区二区| 成人美女视频在线看| 欧美成人一区二区三区在线观看| 亚洲欧洲制服丝袜| 岛国av在线一区| 久久亚区不卡日本| 蜜臀久久99精品久久久久久9| 日本黄色一区二区| 国产精品福利影院| 国产一区二区久久| 精品欧美久久久| 日本欧美大码aⅴ在线播放| 91国内精品野花午夜精品| 中文字幕一区二区不卡| 国产一区在线精品| 亚洲精品在线三区| 久久99精品国产麻豆婷婷洗澡| 91精品国产91久久久久久一区二区| 亚洲另类色综合网站| 91免费视频大全| 亚洲视频在线一区| 91丝袜美女网| 国产精品传媒视频| 91丨porny丨国产| 亚洲精品免费视频| 91久久人澡人人添人人爽欧美 | 国产精品青草久久| 国产成a人亚洲精品|