svn commit: r341650 - in head: contrib/ipfilter/ipsend sys/contrib/ipfilter/netinet

Cy Schubert cy at FreeBSD.org
Thu Dec 6 20:15:56 UTC 2018


Author: cy
Date: Thu Dec  6 20:15:54 2018
New Revision: 341650
URL: https://svnweb.freebsd.org/changeset/base/341650

Log:
  Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
  age, more to come.
  
  MFC after:	1 week

Modified:
  head/contrib/ipfilter/ipsend/ip.c
  head/contrib/ipfilter/ipsend/resend.c
  head/sys/contrib/ipfilter/netinet/ip_compat.h

Modified: head/contrib/ipfilter/ipsend/ip.c
==============================================================================
--- head/contrib/ipfilter/ipsend/ip.c	Thu Dec  6 20:04:01 2018	(r341649)
+++ head/contrib/ipfilter/ipsend/ip.c	Thu Dec  6 20:15:54 2018	(r341650)
@@ -67,9 +67,9 @@ int	send_ether(nfd, buf, len, gwip)
 	bcopy((char *)buf, s + sizeof(*eh), len);
 	if (gwip.s_addr == last_gw.s_addr)
 	    {
-		bcopy(last_arp, (char *)A_A eh->ether_dhost, 6);
+		bcopy(last_arp, (char *) &eh->ether_dhost, 6);
 	    }
-	else if (arp((char *)&gwip, (char *)A_A eh->ether_dhost) == -1)
+	else if (arp((char *)&gwip, (char *) &eh->ether_dhost) == -1)
 	    {
 		perror("arp");
 		return -2;
@@ -109,17 +109,17 @@ int	send_ip(nfd, mtu, ip, gwip, frag)
 
 	eh = (ether_header_t *)ipbuf;
 
-	bzero((char *)A_A eh->ether_shost, sizeof(eh->ether_shost));
+	bzero((char *) &eh->ether_shost, sizeof(eh->ether_shost));
 	if (last_gw.s_addr && (gwip.s_addr == last_gw.s_addr))
 	    {
-		bcopy(last_arp, (char *)A_A eh->ether_dhost, 6);
+		bcopy(last_arp, (char *) &eh->ether_dhost, 6);
 	    }
-	else if (arp((char *)&gwip, (char *)A_A eh->ether_dhost) == -1)
+	else if (arp((char *)&gwip, (char *) &eh->ether_dhost) == -1)
 	    {
 		perror("arp");
 		return -2;
 	    }
-	bcopy((char *)A_A eh->ether_dhost, last_arp, sizeof(last_arp));
+	bcopy((char *) &eh->ether_dhost, last_arp, sizeof(last_arp));
 	eh->ether_type = htons(ETHERTYPE_IP);
 
 	bcopy((char *)ip, (char *)&ipsv, sizeof(*ip));
@@ -136,11 +136,11 @@ int	send_ip(nfd, mtu, ip, gwip, frag)
 	}
 
 	if (ip->ip_src.s_addr != local_ip.s_addr) {
-		(void) arp((char *)&ip->ip_src, (char *)A_A local_arp);
-		bcopy(local_arp, (char *)A_A eh->ether_shost,sizeof(last_arp));
+		(void) arp((char *)&ip->ip_src, (char *) &local_arp);
+		bcopy(local_arp, (char *) &eh->ether_shost,sizeof(last_arp));
 		local_ip = ip->ip_src;
 	} else
-		bcopy(local_arp, (char *)A_A eh->ether_shost, 6);
+		bcopy(local_arp, (char *) &eh->ether_shost, 6);
 
 	if (!frag || (sizeof(*eh) + iplen < mtu))
 	    {

Modified: head/contrib/ipfilter/ipsend/resend.c
==============================================================================
--- head/contrib/ipfilter/ipsend/resend.c	Thu Dec  6 20:04:01 2018	(r341649)
+++ head/contrib/ipfilter/ipsend/resend.c	Thu Dec  6 20:15:54 2018	(r341650)
@@ -97,7 +97,7 @@ int	ip_resend(dev, mtu, r, gwip, datain)
 		return -2;
 	    }
 
-	bzero((char *)A_A eh->ether_shost, sizeof(eh->ether_shost));
+	bzero((char *) &eh->ether_shost, sizeof(eh->ether_shost));
 	if (gwip.s_addr && (arp((char *)&gwip, dhost) == -1))
 	    {
 		perror("arp");
@@ -113,12 +113,12 @@ int	ip_resend(dev, mtu, r, gwip, datain)
 			eh->ether_type = htons((u_short)ETHERTYPE_IP);
 			if (!gwip.s_addr) {
 				if (arp((char *)&gwip,
-					(char *)A_A eh->ether_dhost) == -1) {
+					(char *) &eh->ether_dhost) == -1) {
 					perror("arp");
 					continue;
 				}
 			} else
-				bcopy(dhost, (char *)A_A eh->ether_dhost,
+				bcopy(dhost, (char *) &eh->ether_dhost,
 				      sizeof(dhost));
 			if (!ip->ip_sum)
 				ip->ip_sum = chksum((u_short *)ip,

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_compat.h	Thu Dec  6 20:04:01 2018	(r341649)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h	Thu Dec  6 20:15:54 2018	(r341650)
@@ -758,16 +758,6 @@ typedef	struct	tcpiphdr	tcpiphdr_t;
 #endif
 #define	IPMINLEN(i, h)	((i)->ip_len >= (IP_HL(i) * 4 + sizeof(struct h)))
 
-
-/*
- * XXX - This is one of those *awful* hacks which nobody likes
- */
-#ifdef	ultrix
-#define	A_A
-#else
-#define	A_A	&
-#endif
-
 #define	TCPF_ALL	(TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|\
 			 TH_ECN|TH_CWR)
 


More information about the svn-src-all mailing list