diff options
author | James Carlson <james.d.carlson@sun.com> | 2009-05-29 08:53:34 -0400 |
---|---|---|
committer | James Carlson <james.d.carlson@sun.com> | 2009-05-29 08:53:34 -0400 |
commit | f53eecf557986dac6ededb388fedd6ca63be0350 (patch) | |
tree | fc7a51aa1700243330df3d0b104adb4d5a5097a1 /usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c | |
parent | 00ba712d889cedd6eb0c7de606f61b180572b600 (diff) | |
download | illumos-joyent-f53eecf557986dac6ededb388fedd6ca63be0350.tar.gz |
PSARC 2009/317 Solaris PPP/PPPoE Updates
4695172 3COM has its own incompatible dialect of PPPoE
4704518 security checks on chap peer name cause interoperability problems
4711045 pppd should not be discarding debug information on fatal signals
4711046 pppoec should provide a way to limit match against wildcard service
4714306 sppptun should not use M_ERROR to signal protocol problems
4743677 pppd can trigger latent access server bug
4750809 pppd needs lint cleanup
4947676 spppcomp_wput() allows an unprivileged process to "hang" the system.
5058886 PPPD misses first LCP configuration request
5060749 need a way to log demand-dial action at higher priority
5093264 PPPoE server can omit Service-Name tag in PADS response
6291911 ugly preremove script in SUNWpppdt causes messages on pkgrm from zone
6589814 pppd disavows bad echo-reply count
6636684 PPP should work in non-global exclusive-stack zones
6637245 sppp driver has half-baked _mi_driver_info function
6704096 SUNWpppdu and SUNWpppdr package dependency and content issues
6753945 sppptun doesn't honor clearview vanity naming feature.
Diffstat (limited to 'usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c')
-rw-r--r-- | usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c b/usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c index 24e69c8edd..de1602ce6e 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c +++ b/usr/src/cmd/cmd-inet/usr.lib/pppoe/options.c @@ -21,12 +21,10 @@ /* * PPPoE Server-mode daemon option parsing. * - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -851,7 +849,7 @@ dispatch_keyword(struct parse_state *psp, const char *keybuf) for (kep = key_list; kep->kwe_word != NULL; kep++) { if (kep->kwe_in == psp->ps_state && (*kep->kwe_word == '\0' || - strcasecmp(kep->kwe_word, keybuf) == 0)) { + strcasecmp(kep->kwe_word, keybuf) == 0)) { if (kep->kwe_func != NULL) retv = (*kep->kwe_func)(psp->ps_csvc, keybuf); psp->ps_state = kep->kwe_out; @@ -1419,9 +1417,8 @@ organize_state(struct parse_state *psp) if ((*se2pp)->se_name == slp->sl_entry.se_name || strcmp((*se2pp)-> - se_name, - slp->sl_entry. - se_name) == 0) + se_name, slp->sl_entry. + se_name) == 0) break; /* * We retain a service if it's @@ -1627,7 +1624,7 @@ get_device_list(struct parse_state *psp, int tunfd) for (dlpp = &psp->ps_star; (dlp = *dlpp) != NULL; ) { for (dla = dlalt; dla != NULL; dla = dla->dl_next) if (strcmp(dla->dl_name, dlp->dl_name) == 0) - break; + break; if (dla == NULL) { *dlpp = dlp->dl_next; free(dlp); @@ -1959,10 +1956,6 @@ locate_service(poep_t *poep, int plen, const char *iname, ppptun_atype *pap, break; } seppe = sepp + dep->de_nservices; - /* Clients's requested service must appear in reply. */ - if (tlen != 0 || (ispadi && - !(glob_svc.se_flags & SEF_NOWILD))) - (void) poe_tag_copy(opoe, tagp); if (tlen == 0) { /* * If config specifies "nowild" in a @@ -1976,29 +1969,43 @@ locate_service(poep_t *poep, int plen, const char *iname, ppptun_atype *pap, sepp = seppe; while (sepp < seppe) { sep = *sepp++; - if ((ispadi || !(sep->se_flags & - SEF_NOWILD)) && - allow_service(sep, pap)) { - nsvcs++; - *srvp = (void *)sep; - if (poep->poep_code == - POECODE_PADR) - break; - if (sep->se_name[0] == '\0') - continue; - (void) poe_add_str(opoe, - POETT_SERVICE, - sep->se_name); - } + if (sep->se_name[0] == '\0' || + (sep->se_flags & SEF_NOWILD) || + !allow_service(sep, pap)) + continue; + *srvp = (void *)sep; + /* + * RFC requires that PADO includes the + * wildcard service request in response + * to PADI. + */ + if (ispadi && nsvcs == 0 && + !(glob_svc.se_flags & SEF_NOWILD)) + (void) poe_tag_copy(opoe, tagp); + nsvcs++; + (void) poe_add_str(opoe, POETT_SERVICE, + sep->se_name); + /* If PADR, then one is enough */ + if (!ispadi) + break; } + /* Just for generating error messages */ + if (nsvcs == 0) + (void) poe_tag_copy(opoe, tagp); } else { + /* + * Clients's requested service must appear in + * reply. + */ + (void) poe_tag_copy(opoe, tagp); + /* Requested specific service; find it. */ cp = (char *)POET_DATA(tagp); while (sepp < seppe) { sep = *sepp++; if (strlen(sep->se_name) == tlen && strncasecmp(sep->se_name, cp, - tlen) == 0) { + tlen) == 0) { if (allow_service(sep, pap)) { nsvcs++; *srvp = (void *)sep; @@ -2276,7 +2283,7 @@ dump_configuration(FILE *fp) "Global debug level %d, log to %s; current level %d\n", glob_svc.se_debug, ((glob_svc.se_log == NULL || *glob_svc.se_log == '\0') ? - "syslog" : glob_svc.se_log), + "syslog" : glob_svc.se_log), log_level); if (cur_options == NULL) { (void) fprintf(fp, "No current configuration.\n"); |