Mercurial > hg > dhcpcd
comparison src/dhcpcd.c @ 5570:f32e37b1d371 draft
dhcpcd: Don't roam when anonymous is set
We can now remove the NOCARRIER_PRESERVE_IP define.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 27 Dec 2020 21:59:32 +0000 |
| parents | cebc093fd611 |
| children | 2a519da0f1a2 |
comparison
equal
deleted
inserted
replaced
| 5569:80fba4edc6c5 | 5570:f32e37b1d371 |
|---|---|
| 732 * If the interface is roaming (generally on wireless) | 732 * If the interface is roaming (generally on wireless) |
| 733 * then while we are not up, we are not down either. | 733 * then while we are not up, we are not down either. |
| 734 * Preserve the network state until we either disconnect | 734 * Preserve the network state until we either disconnect |
| 735 * or re-connect. | 735 * or re-connect. |
| 736 */ | 736 */ |
| 737 if (if_roaming(ifp)) { | 737 if (!(ifp->options->options & DHCPCD_ANONYMOUS) && |
| 738 if_roaming(ifp)) | |
| 739 { | |
| 738 dhcpcd_nocarrier_roaming(ifp); | 740 dhcpcd_nocarrier_roaming(ifp); |
| 739 return; | 741 return; |
| 740 } | 742 } |
| 741 | |
| 742 #ifdef NOCARRIER_PRESERVE_IP | |
| 743 if (ifp->flags & IFF_UP && | |
| 744 !(ifp->options->options & DHCPCD_ANONYMOUS)) | |
| 745 { | |
| 746 /* This OS supports the roaming concept on any | |
| 747 * interface. */ | |
| 748 dhcpcd_nocarrier_roaming(ifp); | |
| 749 return; | |
| 750 } | |
| 751 #endif | |
| 752 | 743 |
| 753 loginfox("%s: carrier lost", ifp->name); | 744 loginfox("%s: carrier lost", ifp->name); |
| 754 script_runreason(ifp, "NOCARRIER"); | 745 script_runreason(ifp, "NOCARRIER"); |
| 755 dhcpcd_drop(ifp, 0); | 746 dhcpcd_drop(ifp, 0); |
| 756 | 747 |
