diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2001-06-27 19:28:33 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2001-06-27 19:28:33 +0000 |
commit | 1b92c7e2e1859b67a15244f2686584ac6653d6fe (patch) | |
tree | 405d3d2dbbe5671143b9578b7322bf9920a23c2f | |
parent | 3a9ecbf3a74e98aad86553d4d7ce63ff7f0346b3 (diff) |
don't die if IPV6 isn't there, so that this will work even with
kernels without IPV6 support.
-rw-r--r-- | usr.sbin/dhcp/common/socket.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/dhcp/common/socket.c b/usr.sbin/dhcp/common/socket.c index 02049944dde..34f4ee48b93 100644 --- a/usr.sbin/dhcp/common/socket.c +++ b/usr.sbin/dhcp/common/socket.c @@ -83,14 +83,17 @@ int if_register_socket (info) flag = IPSEC_LEVEL_BYPASS; if (setsockopt (sock, IPPROTO_IP, IP_AUTH_LEVEL, - (char *)&flag, sizeof flag) < 0) - error ("Can't bypass auth IPsec on dhcp socket: %m"); + (char *)&flag, sizeof flag) == -1) + if (errno != ENODEV) + error ("Can't bypass auth IPsec on dhcp socket: %m"); if (setsockopt (sock, IPPROTO_IP, IP_ESP_TRANS_LEVEL, - (char *)&flag, sizeof flag) < 0) - error ("Can't bypass ESP transport on dhcp socket: %m"); + (char *)&flag, sizeof flag) == -1) + if (errno != ENODEV) + error ("Can't bypass ESP transport on dhcp socket: %m"); if (setsockopt (sock, IPPROTO_IP, IP_ESP_NETWORK_LEVEL, - (char *)&flag, sizeof flag) < 0) - error ("Can't bypass ESP network on dhcp socket: %m"); + (char *)&flag, sizeof flag) == -1) + if (errno != ENODEV) + error ("Can't bypass ESP network on dhcp socket: %m"); return sock; } |