Skip to content

Commit 76ccc26

Browse files
committed
Portability improvements:
grep -q is non portable avoid IP_RECVDSTADDR until we need it Spotted by: Ronan Flood
1 parent 3da3e4b commit 76ccc26

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ SRCS='
7575
udp.c
7676
'
7777

78-
if make -v 2>&1 | grep -q GNU ; then
78+
if make -v 2>&1 | grep GNU > /dev/null 2>&1 ; then
7979
echo "make(1) is GNU make."
8080
BSD=false
8181
elif [ -f /usr/share/mk/bsd.prog.mk ] ; then

udp.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ udp_sock(int fam)
5353
if (fd < 0)
5454
return (fd);
5555

56-
#ifdef IP_RECVDSTADDR
57-
i = 1;
58-
if (setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &i, sizeof i) != 0) {
59-
AZ(close(fd));
60-
Fail(ocx, 1, "setsockopt(IP_RECVDSTADDR) failed");
61-
}
62-
#endif
6356
#ifdef SO_TIMESTAMPNS
6457
i = 1;
6558
(void)setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPNS, &i, sizeof i);
@@ -177,14 +170,6 @@ UdpTimedRx(struct ocx *ocx, const struct udp_socket *usc,
177170
(void)TS_Nanosec(ts, tv.tv_sec, tv.tv_usec * 1000LL);
178171
continue;
179172
}
180-
#endif
181-
#ifdef IP_RECVDSTADDR
182-
if (cmsg->cmsg_level == IPPROTO_IP &&
183-
cmsg->cmsg_type == IP_RECVDSTADDR &&
184-
cmsg->cmsg_len == CMSG_LEN(sizeof(in_addr_t))) {
185-
continue;
186-
/* XXX */
187-
}
188173
#endif
189174
Debug(ocx, "RX-msg: %d %d %u ",
190175
cmsg->cmsg_level, cmsg->cmsg_type, cmsg->cmsg_len);

0 commit comments

Comments
 (0)