diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-01-16 15:57:33 -0800 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-01-16 15:57:33 -0800 |
commit | 20df284dab75c9d2d0fe3a2b8eea3a74e0bdde3a (patch) | |
tree | 6fc42c7adf805550732a8c8cf7059e937e1ad82e | |
parent | d9269b0d98a62fc9ebfdf498888996b0a3c88426 (diff) |
libwimaxll: _open() verifies the multicast group id was filled up or fail
The open() code wasn't catching the error case of:
- the kernel being too old and not supporting generic netlink
multicast group lookups (implemented in 2.6.23)
- the group not existing
This patch fixes that by returning -ENXIO in said case.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r-- | lib/op-open.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/op-open.c b/lib/op-open.c index 3950427..e7630d1 100644 --- a/lib/op-open.c +++ b/lib/op-open.c @@ -297,7 +297,15 @@ int wimaxll_gnl_resolve(struct wimaxll_handle *wmx) wmx->gnl_family_id = result; d_printf(1, wmx, "D: WiMAX device %s, genl family ID %d\n", wmx->name, wmx->gnl_family_id); + wmx->mcg_id = -1; nl_get_multicast_groups(wmx->nlh_tx, "WiMAX", wimaxll_mc_group_cb, wmx); + if (wmx->mcg_id == -1) { + wimaxll_msg(wmx, "E: %s: cannot resolve multicast group ID; " + "your kernel might be too old (< 2.6.23).\n", + wmx->name); + result = -ENXIO; + goto error_mcg_resolve; + } version = genl_ctrl_get_version(wmx->nlh_tx, "WiMAX"); /* Check version compatibility -- check include/linux/wimax.h @@ -317,6 +325,7 @@ int wimaxll_gnl_resolve(struct wimaxll_handle *wmx) "version (%d) is lower that supported %d; things " "might not work\n", minor, WIMAX_GNL_VERSION % 10); error_bad_major: +error_mcg_resolve: error_ctrl_resolve: error_no_dev: d_fnend(5, wmx, "(wmx %p) = %d\n", wmx, result); |