Module Name: src Committed By: christos Date: Sun Apr 24 17:32:06 UTC 2016
Modified Files: src/sys/net: if_spppsubr.c Log Message: CID 980345: missing breaks To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/net/if_spppsubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_spppsubr.c diff -u src/sys/net/if_spppsubr.c:1.138 src/sys/net/if_spppsubr.c:1.139 --- src/sys/net/if_spppsubr.c:1.138 Sun Apr 24 12:59:15 2016 +++ src/sys/net/if_spppsubr.c Sun Apr 24 13:32:06 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.138 2016/04/24 16:59:15 christos Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.139 2016/04/24 17:32:06 christos Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.138 2016/04/24 16:59:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.139 2016/04/24 17:32:06 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -5370,7 +5370,9 @@ sppp_cp_type_name(u_char type) static const char * sppp_auth_type_name(u_short proto, u_char type) { - static char buf[12]; + static char buf[32]; + const char *name; + switch (proto) { case PPP_CHAP: switch (type) { @@ -5378,17 +5380,25 @@ sppp_auth_type_name(u_short proto, u_cha case CHAP_RESPONSE: return "response"; case CHAP_SUCCESS: return "success"; case CHAP_FAILURE: return "failure"; + default: name = "chap"; break; } break; + case PPP_PAP: switch (type) { case PAP_REQ: return "req"; case PAP_ACK: return "ack"; case PAP_NAK: return "nak"; + default: name = "pap"; break; } break; + + default: + name = "bad"; + break; } - snprintf(buf, sizeof(buf), "0x%x", type); + + snprintf(buf, sizeof(buf), "%s(%#x) %#x", name, proto, type); return buf; }