Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/dhcpcd/dist Sync



details:   https://anonhg.NetBSD.org/src/rev/307634e052c0
branches:  trunk
changeset: 784442:307634e052c0
user:      roy <roy%NetBSD.org@localhost>
date:      Mon Jan 28 15:46:52 2013 +0000

description:
Sync

diffstat:

 external/bsd/dhcpcd/dist/dhcp.c |  27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diffs (65 lines):

diff -r 2de0b7540766 -r 307634e052c0 external/bsd/dhcpcd/dist/dhcp.c
--- a/external/bsd/dhcpcd/dist/dhcp.c   Mon Jan 28 15:45:10 2013 +0000
+++ b/external/bsd/dhcpcd/dist/dhcp.c   Mon Jan 28 15:46:52 2013 +0000
@@ -789,9 +789,9 @@
  * If we have a CSR then we only use that.
  * Otherwise we add static routes and then routers. */
 struct rt *
-get_option_routes(const struct dhcp_message *dhcp,
-    const char *ifname, unsigned long long *opts)
+get_option_routes(struct interface *ifp, const struct dhcp_message *dhcp)
 {
+       struct if_options *ifo = ifp->state->options;
        const uint8_t *p;
        const uint8_t *e;
        struct rt *routes = NULL;
@@ -799,25 +799,31 @@
        int len;
 
        /* If we have CSR's then we MUST use these only */
-       p = get_option(dhcp, DHO_CSR, &len, NULL);
+       if (!has_option_mask(ifo->nomask, DHO_CSR))
+               p = get_option(dhcp, DHO_CSR, &len, NULL);
+       else
+               p = NULL;
        /* Check for crappy MS option */
-       if (!p)
+       if (!p && !has_option_mask(ifo->nomask, DHO_MSCSR))
                p = get_option(dhcp, DHO_MSCSR, &len, NULL);
        if (p) {
                routes = decode_rfc3442_rt(len, p);
                if (routes) {
-                       if (!(*opts & DHCPCD_CSR_WARNED)) {
+                       if (!(ifo->options & DHCPCD_CSR_WARNED)) {
                                syslog(LOG_DEBUG,
                                    "%s: using Classless Static Routes",
-                                   ifname);
-                               *opts |= DHCPCD_CSR_WARNED;
+                                   ifp->name);
+                               ifo->options |= DHCPCD_CSR_WARNED;
                        }
                        return routes;
                }
        }
 
        /* OK, get our static routes first. */
-       p = get_option(dhcp, DHO_STATICROUTE, &len, NULL);
+       if (!has_option_mask(ifo->nomask, DHO_STATICROUTE))
+               p = get_option(dhcp, DHO_STATICROUTE, &len, NULL);
+       else
+               p = NULL;
        if (p) {
                e = p + len;
                while (p < e) {
@@ -836,7 +842,10 @@
        }
 
        /* Now grab our routers */
-       p = get_option(dhcp, DHO_ROUTER, &len, NULL);
+       if (!has_option_mask(ifo->nomask, DHO_ROUTER))
+               p = get_option(dhcp, DHO_ROUTER, &len, NULL);
+       else
+               p = NULL;
        if (p) {
                e = p + len;
                while (p < e) {



Home | Main Index | Thread Index | Old Index