diff options
| author | Roy Marples <roy@marples.name> | 2008-09-12 18:08:07 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2008-09-12 18:08:07 +0000 |
| commit | 441f7d159dbb8448f075e177f9c3770503fc6aa4 (patch) | |
| tree | d15137305cff6bf6da5a7343f88691f17fa79859 /if-linux.c | |
| parent | be070f751ba8033aebb08e1cece0f0081d9c2a88 (diff) | |
| download | dhcpcd-441f7d159dbb8448f075e177f9c3770503fc6aa4.tar.xz | |
Remove remembering routes per interface and have a global routing table so we can change routes depending on interface state. This is very useful for the BSD's where there is no route metric.
Diffstat (limited to 'if-linux.c')
| -rw-r--r-- | if-linux.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -365,7 +365,10 @@ if_route(const struct interface *iface, else { nlm->hdr.nlmsg_flags |= NLM_F_CREATE | NLM_F_EXCL; /* We only change route metrics for kernel routes */ - nlm->rt.rtm_protocol = action ? RTPROT_BOOT : RTPROT_KERNEL; + if (action == 0 && netmask->s_addr == iface->net.s_addr) + nlm->rt.rtm_protocol = RTPROT_KERNEL; + else + nlm->rt.rtm_protocol = RTPROT_BOOT; if (gateway->s_addr == INADDR_ANY) nlm->rt.rtm_scope = RT_SCOPE_LINK; else |
