Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/wpa/dist/src/drivers fix debugging:



details:   https://anonhg.NetBSD.org/src/rev/45296fcafd33
branches:  trunk
changeset: 760074:45296fcafd33
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 25 20:45:49 2010 +0000

description:
fix debugging:
- don't print junk for the interface name
- parse and print known rtm messages we get

diffstat:

 external/bsd/wpa/dist/src/drivers/driver_bsd.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r 535f48408f4f -r 45296fcafd33 external/bsd/wpa/dist/src/drivers/driver_bsd.c
--- a/external/bsd/wpa/dist/src/drivers/driver_bsd.c    Sat Dec 25 20:37:44 2010 +0000
+++ b/external/bsd/wpa/dist/src/drivers/driver_bsd.c    Sat Dec 25 20:45:49 2010 +0000
@@ -1258,22 +1258,41 @@
                        wpa_supplicant_event(ctx, EVENT_INTERFACE_STATUS, &event);
                } else if ((ifm->ifm_flags & IFF_UP) != 0 &&
                    (drv->flags & IFF_UP) == 0) {
-                       strlcpy(event.interface_status.ifname, drv->ifname,
+                       os_strlcpy(event.interface_status.ifname, drv->ifname,
                                sizeof(event.interface_status.ifname));
                        event.interface_status.ievent = EVENT_INTERFACE_ADDED;
                        wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
                                   event.interface_status.ifname);
                        wpa_supplicant_event(ctx, EVENT_INTERFACE_STATUS, &event);
                } else {
+                       os_strlcpy(event.interface_status.ifname, drv->ifname,
+                               sizeof(event.interface_status.ifname));
                        wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' "
                            "if=%x drv=%x", event.interface_status.ifname,
                            ifm->ifm_flags, drv->flags);
                }
                drv->flags = ifm->ifm_flags;
                break;
+#ifdef RTM_OIFINFO
+       case RTM_OIFINFO:
+               wpa_printf(MSG_DEBUG, "RTM_OIFINFO ignored");
+               break;
+#endif
+#ifdef RTM_OOIFINFO
+       case RTM_OOIFINFO:
+               wpa_printf(MSG_DEBUG, "RTM_OOIFINFO ignored");
+               break;
+#endif
+#ifdef RTM_LOSING
        case RTM_LOSING:
-               wpa_printf(MSG_DEBUG, "RTM_LOSING: %d", rtm->rtm_type);
+               wpa_printf(MSG_DEBUG, "RTM_LOSING ignored");
                break;
+#endif
+#ifdef RTM_MISS
+       case RTM_MISS:
+               wpa_printf(MSG_DEBUG, "RTM_MISS ignored");
+               break;
+#endif
        default:
                wpa_printf(MSG_DEBUG, "RTM_???: %d", rtm->rtm_type);
                break;



Home | Main Index | Thread Index | Old Index