[PATCH] tcp_diag build failure without CONFIG_IPV6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In latest bk, tcp_diag has some changes which make it fail to
compile without IPV6 enabled.  While the below patch is likely
not the best/cleanest solution, it at least allows building.

Phil


--- linux-2.6.9/net/ipv4/tcp_diag.c	2004-11-04 14:19:07.289958272 -0500
+++ linux-std/net/ipv4/tcp_diag.c	2004-11-04 14:18:19.455230256 -0500
@@ -103,12 +103,14 @@
 		r->tcpdiag_wqueue = 0;
 		r->tcpdiag_uid = 0;
 		r->tcpdiag_inode = 0;
+#ifdef CONFIG_IP_TCPDIAG_IPV6
 		if (r->tcpdiag_family == AF_INET6) {
 			ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_src,
 				       &tw->tw_v6_rcv_saddr);
 			ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_dst,
 				       &tw->tw_v6_daddr);
 		}
+#endif
 		nlh->nlmsg_len = skb->tail - b;
 		return skb->len;
 	}
@@ -482,12 +484,14 @@
 	r->tcpdiag_wqueue = 0;
 	r->tcpdiag_uid = sock_i_uid(sk);
 	r->tcpdiag_inode = 0;
+#ifdef CONFIG_IP_TCPDIAG_IPV6
 	if (r->tcpdiag_family == AF_INET6) {
 		ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_src,
 			       &req->af.v6_req.loc_addr);
 		ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_dst,
 			       &req->af.v6_req.rmt_addr);
 	}
+#endif
 	nlh->nlmsg_len = skb->tail - b;
 
 	return skb->len;
@@ -543,12 +547,16 @@
 
 			if (bc) {
 				entry.saddr =
+#ifdef CONFIG_IP_TCPDIAG_IPV6
 					(entry.family == AF_INET6) ?
 					req->af.v6_req.loc_addr.s6_addr32 :
+#endif
 					&req->af.v4_req.loc_addr;
 				entry.daddr = 
+#ifdef CONFIG_IP_TCPDIAG_IPV6
 					(entry.family == AF_INET6) ?
 					req->af.v6_req.rmt_addr.s6_addr32 :
+#endif
 					&req->af.v4_req.rmt_addr;
 				entry.dport = ntohs(req->rmt_port);
 

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux