Loading net/ipv4/ipvs/ip_vs_proto.c +59 −4 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ const char * ip_vs_state_name(__u16 proto, int state) void ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, ip_vs_tcpudp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) Loading Loading @@ -189,6 +189,61 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #ifdef CONFIG_IP_VS_IPV6 void ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[192]; struct ipv6hdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if (ih == NULL) sprintf(buf, "%s TRUNCATED", pp->name); else if (ih->nexthdr == IPPROTO_FRAGMENT) sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT " frag", pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); else { __be16 _ports[2], *pptr; pptr = skb_header_pointer(skb, offset + sizeof(struct ipv6hdr), sizeof(_ports), _ports); if (pptr == NULL) sprintf(buf, "%s TRUNCATED " NIP6_FMT "->" NIP6_FMT, pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); else sprintf(buf, "%s " NIP6_FMT ":%u->" NIP6_FMT ":%u", pp->name, NIP6(ih->saddr), ntohs(pptr[0]), NIP6(ih->daddr), ntohs(pptr[1])); } printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #endif void ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { #ifdef CONFIG_IP_VS_IPV6 if (skb->protocol == __constant_htons(ETH_P_IPV6)) ip_vs_tcpudp_debug_packet_v6(pp, skb, offset, msg); else #endif ip_vs_tcpudp_debug_packet_v4(pp, skb, offset, msg); } int __init ip_vs_protocol_init(void) { Loading net/ipv4/ipvs/ip_vs_proto_ah_esp.c +34 −2 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ ah_esp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, static void ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, ah_esp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[256]; Loading @@ -142,6 +142,38 @@ ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #ifdef CONFIG_IP_VS_IPV6 static void ah_esp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[256]; struct ipv6hdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if (ih == NULL) sprintf(buf, "%s TRUNCATED", pp->name); else sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT, pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #endif static void ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { #ifdef CONFIG_IP_VS_IPV6 if (skb->protocol == __constant_htons(ETH_P_IPV6)) ah_esp_debug_packet_v6(pp, skb, offset, msg); else #endif ah_esp_debug_packet_v4(pp, skb, offset, msg); } static void ah_esp_init(struct ip_vs_protocol *pp) { Loading Loading
net/ipv4/ipvs/ip_vs_proto.c +59 −4 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ const char * ip_vs_state_name(__u16 proto, int state) void ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, ip_vs_tcpudp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) Loading Loading @@ -189,6 +189,61 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #ifdef CONFIG_IP_VS_IPV6 void ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[192]; struct ipv6hdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if (ih == NULL) sprintf(buf, "%s TRUNCATED", pp->name); else if (ih->nexthdr == IPPROTO_FRAGMENT) sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT " frag", pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); else { __be16 _ports[2], *pptr; pptr = skb_header_pointer(skb, offset + sizeof(struct ipv6hdr), sizeof(_ports), _ports); if (pptr == NULL) sprintf(buf, "%s TRUNCATED " NIP6_FMT "->" NIP6_FMT, pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); else sprintf(buf, "%s " NIP6_FMT ":%u->" NIP6_FMT ":%u", pp->name, NIP6(ih->saddr), ntohs(pptr[0]), NIP6(ih->daddr), ntohs(pptr[1])); } printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #endif void ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { #ifdef CONFIG_IP_VS_IPV6 if (skb->protocol == __constant_htons(ETH_P_IPV6)) ip_vs_tcpudp_debug_packet_v6(pp, skb, offset, msg); else #endif ip_vs_tcpudp_debug_packet_v4(pp, skb, offset, msg); } int __init ip_vs_protocol_init(void) { Loading
net/ipv4/ipvs/ip_vs_proto_ah_esp.c +34 −2 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ ah_esp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_protocol *pp, static void ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, ah_esp_debug_packet_v4(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[256]; Loading @@ -142,6 +142,38 @@ ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #ifdef CONFIG_IP_VS_IPV6 static void ah_esp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { char buf[256]; struct ipv6hdr _iph, *ih; ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); if (ih == NULL) sprintf(buf, "%s TRUNCATED", pp->name); else sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT, pp->name, NIP6(ih->saddr), NIP6(ih->daddr)); printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); } #endif static void ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, int offset, const char *msg) { #ifdef CONFIG_IP_VS_IPV6 if (skb->protocol == __constant_htons(ETH_P_IPV6)) ah_esp_debug_packet_v6(pp, skb, offset, msg); else #endif ah_esp_debug_packet_v4(pp, skb, offset, msg); } static void ah_esp_init(struct ip_vs_protocol *pp) { Loading