Consistently use socket(..., AF_INET) for routing
authorkrw <krw@openbsd.org>
Wed, 28 Jun 2017 12:53:46 +0000 (12:53 +0000)
committerkrw <krw@openbsd.org>
Wed, 28 Jun 2017 12:53:46 +0000 (12:53 +0000)
sockets to cut down on unwanted IPv6 messages.

suggested by & ok claudio@

sbin/dhclient/dhclient.c

index 4803574..6acc6c5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhclient.c,v 1.449 2017/06/27 13:24:49 krw Exp $      */
+/*     $OpenBSD: dhclient.c,v 1.450 2017/06/28 12:53:46 krw Exp $      */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -612,7 +612,7 @@ main(int argc, char *argv[])
        if (ifi->linkstat == 0)
                interface_link_forceup(ifi->name);
 
-       if ((routefd = socket(PF_ROUTE, SOCK_RAW, 0)) == -1)
+       if ((routefd = socket(PF_ROUTE, SOCK_RAW, AF_INET)) == -1)
                fatal("socket(PF_ROUTE, SOCK_RAW)");
 
        rtfilter = ROUTE_FILTER(RTM_PROPOSAL) | ROUTE_FILTER(RTM_NEWADDR) |