diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-05-22 12:56:32 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-05-22 12:56:32 +0000 |
commit | cba05c10b1ef7e919e3fc2a2f1287fae42ea5566 (patch) | |
tree | d3f6f037547d4eaac7065781b82f25de337590df /sbin/dhclient/dhclient.c | |
parent | e7edee45c513c67b00c1dfaab5ffb01d25a84982 (diff) |
Don't get & apply a new lease for an RTM_IFINFO that reports a change
to the MTU of the interface. Such message are generated by the
application of a lease containing interface-mtu, and thus caused a
duplicate lease negotiation and application when that option
was present.
This rapid duplication confused Google Compute Engine.
Noticed and fix tested by Greg Steuck. Also tested by Bj??rn Ketelaars
to make sure Dutch Railways still worked. Thanks!
ok claudio@
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r-- | sbin/dhclient/dhclient.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index fe3ed74a1d5..c7df8d40cea 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.634 2019/05/10 18:50:11 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.635 2019/05/22 12:56:31 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -259,6 +259,8 @@ interface_state(struct interface_info *ifi) } else { ifi->link_state = ((struct if_data *)ifa->ifa_data)->ifi_link_state; + ifi->mtu = + ((struct if_data *)ifa->ifa_data)->ifi_mtu; } freeifaddrs(ifap); @@ -342,6 +344,7 @@ rtm_dispatch(struct interface_info *ifi, struct rt_msghdr *rtm) struct if_announcemsghdr *ifan; struct ifa_msghdr *ifam; struct if_ieee80211_data *ifie; + uint32_t oldmtu; switch (rtm->rtm_type) { case RTM_PROPOSAL: @@ -375,9 +378,13 @@ rtm_dispatch(struct interface_info *ifi, struct rt_msghdr *rtm) if ((rtm->rtm_flags & RTF_UP) == 0) fatalx("down"); + oldmtu = ifi->mtu; interface_state(ifi); - if (quit == 0) + if (oldmtu == ifi->mtu) quit = RESTART; + else + log_debug("%s: MTU change RTM_IFINFO ignored", + log_procname); break; case RTM_80211INFO: |