diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-01-10 16:33:48 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-01-10 16:33:48 +0000 |
commit | 815b3fadead0a8d185c7c0d4225f0d76d05172e5 (patch) | |
tree | 07cedfdb117206c1cbbab8d03693171ef7936e51 /sbin/dhclient/dhclient.c | |
parent | 88808c6031c351acfd8dd84873210a3e9e9c217b (diff) |
Use the kernel set ifam_hdrlen so that ABI changes won't cause older
binaries to stop working.
OK krw@, michele@, henning@, dlg@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 0f9be10db1e..41aba9870c2 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.120 2008/06/07 03:22:26 deraadt Exp $ */ +/* $OpenBSD: dhclient.c,v 1.121 2009/01/10 16:33:47 claudio Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -180,9 +180,11 @@ routehandler(void) ifam = (struct ifa_msghdr *)rtm; if (ifam->ifam_index != ifi->index) break; - if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET) + if (findproto((char *)ifam + ifam->ifam_hdrlen, + ifam->ifam_addrs) != AF_INET) break; - sa = get_ifa((char *)(ifam + 1), ifam->ifam_addrs); + sa = get_ifa((char *)ifam + ifam->ifam_hdrlen, + ifam->ifam_addrs); if (sa == NULL) goto die; @@ -206,7 +208,8 @@ routehandler(void) ifam = (struct ifa_msghdr *)rtm; if (ifam->ifam_index != ifi->index) break; - if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET) + if (findproto((char *)ifam + ifam->ifam_hdrlen, + ifam->ifam_addrs) != AF_INET) break; if (scripttime == 0 || t < scripttime + 10) break; |